package com.paic.mhis.hcpms.quota.exportword.biz.service.impl;

import java.util.List;
import java.util.Map;

import org.jfree.data.category.CategoryDataset;
import org.jfree.data.category.DefaultCategoryDataset;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;

import com.lowagie.text.Table;
import com.paic.mhis.hcpms.quota.exportword.biz.service.QueryKpiQuotaDataService;
import com.paic.mhis.hcpms.quota.exportword.biz.service.WordReportService;
import com.paic.mhis.hcpms.quota.exportword.dto.BaseChartDTO;
import com.paic.mhis.hcpms.quota.exportword.dto.FeeCheckDTO;
import com.paic.mhis.hcpms.quota.exportword.dto.KpiBatchDTO;
import com.paic.mhis.hcpms.quota.exportword.itext.CreateRtfTableDataHelper;
import com.paic.mhis.hcpms.quota.exportword.itext.RtfElementDataHelper;
import com.paic.mhis.hcpms.quota.exportword.jfreechart.JFreeChartHelper;
import com.paic.mhis.hcpms.quota.exportword.jfreechart.MakeJFreeChartImgParamHelper;
import com.paic.mhis.hcpms.quota.exportword.utils.GeneralMethods;
import com.paic.mhis.hcpms.quota.settlement.common.KpiValueConst;
import com.paic.pafa.app.lwc.core.util.CollectionUtils;

/**
 * 调用各部分接口，
 * 
 * @author: EX-XIONGFEI002
 * @version: 1.0
 */
@Service("queryKpiQuotaDataService")
public class QueryKpiQuotaDataServiceImpl implements QueryKpiQuotaDataService {

	@Value("${rtfReportTemplatePath}")
	private String rtfReportTemplatePath;

	@Autowired
	private WordReportService wordReportService;

	@Autowired
	private JFreeChartHelper jFreeChartHelper;

	/**
	 * 张纪成:总费用 第一部分和第三部分
	 * 
	 * @param resultMap
	 *            resultMap
	 * @param paramMap
	 *            paramMap
	 * @param kpiQuotaLimitMap
	 *            kpiQuotaLimitMap
	 * @param kpiBatchDTO
	 *            kpiBatchDTO
	 */
	@Override
	public void getTotFeeData(Map<String, Object> resultMap, Map<String, Object> paramMap,
			Map<String, Object> kpiQuotaLimitMap, KpiBatchDTO kpiBatchDTO) {
		Map<String, Object> totalFeePredict = wordReportService.getTotalFeePredict(paramMap, kpiQuotaLimitMap);
		GeneralMethods.getInstance().addAllValueToMap(totalFeePredict, resultMap);

		// 总费用
		if (KpiValueConst.WORD_PARTY_1.equals(paramMap.get("type"))) {
			MakeJFreeChartImgParamHelper.makeMeterImgParamData(resultMap, paramMap, kpiQuotaLimitMap, new String[] {
					"同比", "k0_1_1_1_yoy_end", "KPI0001", "0", "k0_1_1_1_yoy_flag_end" });
			jFreeChartHelper.createMeterChart(resultMap, paramMap, "k0_1_1_1_meter_yoy_img");

			// 1、 生成同比环比仪表盘
			MakeJFreeChartImgParamHelper.makeMeterImgParamData(resultMap, paramMap, kpiQuotaLimitMap, new String[] {
					"环比", "k0_1_1_1_mom_end", "KPI0001", "1", "k0_1_1_1_mom_flag_end" });
			jFreeChartHelper.createMeterChart(resultMap, paramMap, "k0_1_1_1_meter_mom_img");

			// 2、医保费用占比
			paramMap.put("xyLine_chartDTO", new BaseChartDTO("医疗总费用  趋势图(亿元)", "1"));
			paramMap.put(
					"xyLine_chartDataDTO",
					RtfElementDataHelper.getInstance().createTotalFeeSeriesList(resultMap, KpiValueConst.WORD_PARTY_1,
							kpiBatchDTO.getKpiTime()));

			// 生成趋势图
			jFreeChartHelper.createXYLineChart(resultMap, paramMap, "k0_1_1_1_totalFee_xyLine_img");

			// 3、医保费用同比环比变化趋势图
			paramMap.put("xyLine_chartDTO", new BaseChartDTO("医疗总费用  同比环比变化趋势图", "2"));
			paramMap.put(
					"xyLine_chartDataDTO",
					RtfElementDataHelper.getInstance().createTotalFeeYcSeriesList(resultMap,
							KpiValueConst.WORD_PARTY_1, kpiBatchDTO.getKpiTime()));

			// 生成医保占比预测趋势图
			jFreeChartHelper.createXYLineChart(resultMap, paramMap, "k0_1_1_1_totalFee_yc_img");

		} else if (KpiValueConst.WORD_PARTY_3.equals(paramMap.get("type"))) {
			// 同比环比趋势图
			MakeJFreeChartImgParamHelper.makeMeterImgParamData(resultMap, paramMap, kpiQuotaLimitMap, new String[] {
					"同比", "k2_1_1_1_yoy_end", "KPI0001", "0", "k2_1_1_1_yoy_flag_end" });
			jFreeChartHelper.createMeterChart(resultMap, paramMap, "k2_1_1_1_totalFee_meter_yoy_img");

			MakeJFreeChartImgParamHelper.makeMeterImgParamData(resultMap, paramMap, kpiQuotaLimitMap, new String[] {
					"环比", "k2_1_1_1_mom_end", "KPI0001", "1", "k2_1_1_1_mom_flag_end" });
			jFreeChartHelper.createMeterChart(resultMap, paramMap, "k2_1_1_1_totalFee_meter_mom_img");

			paramMap.put("xyLine_chartDTO", new BaseChartDTO("医疗总费用  趋势图(万元)", "1"));
			paramMap.put(
					"xyLine_chartDataDTO",
					RtfElementDataHelper.getInstance().createTotalFeeSeriesList(resultMap, KpiValueConst.WORD_PARTY_3,
							kpiBatchDTO.getKpiTime()));

			jFreeChartHelper.createXYLineChart(resultMap, paramMap, "k2_1_1_1_xyLine_img");

			// 3、住院费用 同比环比变化趋势图
			paramMap.put("xyLine_chartDTO", new BaseChartDTO("医疗总费用  同比环比变化趋势图", "2"));
			paramMap.put(
					"xyLine_chartDataDTO",
					RtfElementDataHelper.getInstance().createTotalFeeYcSeriesList(resultMap,
							KpiValueConst.WORD_PARTY_3, kpiBatchDTO.getKpiTime()));

			jFreeChartHelper.createXYLineChart(resultMap, paramMap, "k2_1_1_1_xyLine_yc_img");
		}
	}

	/**
	 * 张纪成 总费用:医疗费用占比
	 * 
	 * @param resultMap
	 *            resultMap
	 * @param paramMap
	 *            paramMap
	 * @param kpiQuotaLimitMap
	 *            kpiQuotaLimitMap
	 * @param kpiBatchDTO
	 *            kpiBatchDTO
	 */
	@Override
	public void getMedFeeData(Map<String, Object> resultMap, Map<String, Object> paramMap,
			Map<String, Object> kpiQuotaLimitMap, KpiBatchDTO kpiBatchDTO) {
		Map<String, Object> percentPredict = wordReportService.getPercentPredict(paramMap, kpiQuotaLimitMap);

		GeneralMethods.getInstance().addAllValueToMap(percentPredict, resultMap);

		// 总费用
		if (KpiValueConst.WORD_PARTY_1.equals(paramMap.get("type"))) {
			MakeJFreeChartImgParamHelper.makeMeterImgParamData(resultMap, paramMap, kpiQuotaLimitMap, new String[] {
					"同比", "k0_1_1_2_yoy_end", "KPI0002", "0", "k0_1_1_2_yoy_flag_end" });
			jFreeChartHelper.createMeterChart(resultMap, paramMap, "k0_1_1_2_meter_yoy_img");

			// 1、 生成同比环比仪表盘
			MakeJFreeChartImgParamHelper.makeMeterImgParamData(resultMap, paramMap, kpiQuotaLimitMap, new String[] {
					"环比", "k0_1_1_2_mom_end", "KPI0002", "1", "k0_1_1_2_mom_flag_end" });
			jFreeChartHelper.createMeterChart(resultMap, paramMap, "k0_1_1_2_meter_mom_img");

			// 2、医保费用占比
			paramMap.put("xyLine_chartDTO", new BaseChartDTO("医保费用占比  趋势图", "2"));
			paramMap.put(
					"xyLine_chartDataDTO",
					RtfElementDataHelper.getInstance().createTotalFeeRateSeriesList(resultMap,
							KpiValueConst.WORD_PARTY_1, kpiBatchDTO.getKpiTime()));

			// 生成趋势图
			jFreeChartHelper.createXYLineChart(resultMap, paramMap, "k0_1_1_2_Fee_Rate_xyLine_img");

			// 3、医保费用同比环比变化趋势图
			paramMap.put("xyLine_chartDTO", new BaseChartDTO("医保费用占比  同比环比变化趋势图", "2"));
			paramMap.put(
					"xyLine_chartDataDTO",
					RtfElementDataHelper.getInstance().createTotalFeeRateYcSeriesList(resultMap,
							KpiValueConst.WORD_PARTY_1, kpiBatchDTO.getKpiTime()));

			// 生成医保占比预测趋势图
			jFreeChartHelper.createXYLineChart(resultMap, paramMap, "k0_1_1_2_Fee_Rate_xyLine_yc_img");

		} else if (KpiValueConst.WORD_PARTY_3.equals(paramMap.get("type"))) {
			// 同比环比趋势图
			MakeJFreeChartImgParamHelper.makeMeterImgParamData(resultMap, paramMap, kpiQuotaLimitMap, new String[] {
					"同比", "k2_1_1_2_yoy_end", "KPI0002", "0", "k2_1_1_2_yoy_flag_end" });
			jFreeChartHelper.createMeterChart(resultMap, paramMap, "k2_1_1_2_meter_yoy_img");

			MakeJFreeChartImgParamHelper.makeMeterImgParamData(resultMap, paramMap, kpiQuotaLimitMap, new String[] {
					"环比", "k2_1_1_2_mom_end", "KPI0002", "1", "k2_1_1_2_mom_flag_end" });
			jFreeChartHelper.createMeterChart(resultMap, paramMap, "k2_1_1_2_meter_mom_img");

			paramMap.put("xyLine_chartDTO", new BaseChartDTO("医保费用占比  趋势图", "2"));
			paramMap.put(
					"xyLine_chartDataDTO",
					RtfElementDataHelper.getInstance().createTotalFeeRateSeriesList(resultMap,
							KpiValueConst.WORD_PARTY_3, kpiBatchDTO.getKpiTime()));

			jFreeChartHelper.createXYLineChart(resultMap, paramMap, "k2_1_1_2_Fee_Rate_xyLine_img");

			// 3、住院费用 同比环比变化趋势图
			paramMap.put("xyLine_chartDTO", new BaseChartDTO("医保费用占比  同比环比变化趋势图", "2"));
			paramMap.put(
					"xyLine_chartDataDTO",
					RtfElementDataHelper.getInstance().createTotalFeeRateYcSeriesList(resultMap,
							KpiValueConst.WORD_PARTY_3, kpiBatchDTO.getKpiTime()));

			jFreeChartHelper.createXYLineChart(resultMap, paramMap, "k2_1_1_2_Fee_Rate_xyLine_yc_img");

		}
	}

	/**
	 * 杨理刚:住院费用
	 * 
	 * @param resultMap
	 *            resultMap
	 * @param paramMap
	 *            paramMap
	 * @param kpiQuotaLimitMap
	 *            kpiQuotaLimitMap
	 * @param kpiBatchDTO
	 *            kpiBatchDTO
	 */
	@Override
	public void getHospFeeData(Map<String, Object> resultMap, Map<String, Object> paramMap,
			Map<String, Object> kpiQuotaLimitMap, KpiBatchDTO kpiBatchDTO) {

		Map<String, Object> hosFeeToWord = wordReportService.getHosFeeToWord(paramMap, kpiQuotaLimitMap);

		GeneralMethods.getInstance().addAllValueToMap(hosFeeToWord, resultMap);

		// 住院費用的同比、生成同比环比
		if (KpiValueConst.WORD_PARTY_1.equals(paramMap.get("type"))) {
			MakeJFreeChartImgParamHelper.makeMeterImgParamData(resultMap, paramMap, kpiQuotaLimitMap, new String[] {
					"同比", "k0_2_1_1_fee_yoy_end", "KPI0001", "0", "k0_2_1_1_fee_yoy_flag_end" });
			jFreeChartHelper.createMeterChart(resultMap, paramMap, "k0_2_1_1_Fee_meter_yoy_img");

			// 1、 生成同比环比仪表盘
			MakeJFreeChartImgParamHelper.makeMeterImgParamData(resultMap, paramMap, kpiQuotaLimitMap, new String[] {
					"环比", "k0_2_1_1_fee_mom_end", "KPI0001", "1", "k0_2_1_1_fee_mom_flag_end" });
			jFreeChartHelper.createMeterChart(resultMap, paramMap, "k0_2_1_1_Fee_meter_mom_img");

			// 2、医保费用占比
			paramMap.put("xyLine_chartDTO", new BaseChartDTO("住院医疗费用  趋势图(亿元)", "1"));
			paramMap.put(
					"xyLine_chartDataDTO",
					RtfElementDataHelper.getInstance().createHospAOutpatFeeSeriesList(resultMap,
							KpiValueConst.WORD_PARTY_1, kpiBatchDTO.getKpiTime(), true));

			jFreeChartHelper.createXYLineChart(resultMap, paramMap, "k0_2_1_1_Fee_xyLine_img");

			// 3、医保费用同比环比变化趋势图
			paramMap.put("xyLine_chartDTO", new BaseChartDTO("住院医疗费用  同比环比变化趋势图", "2"));
			paramMap.put(
					"xyLine_chartDataDTO",
					RtfElementDataHelper.getInstance().createHospMedYcSeriesList(resultMap, KpiValueConst.WORD_PARTY_1,
							kpiBatchDTO.getKpiTime(), true));

			jFreeChartHelper.createXYLineChart(resultMap, paramMap, "k0_2_1_1_Fee_yc_img");

		} else if (KpiValueConst.WORD_PARTY_3.equals(paramMap.get("type"))) {
			// 同比环比趋势图
			MakeJFreeChartImgParamHelper.makeMeterImgParamData(resultMap, paramMap, kpiQuotaLimitMap, new String[] {
					"同比", "k2_2_1_1_fee_yoy_end", "KPI0001", "0", "k2_2_1_1_fee_yoy_flag_end" });
			jFreeChartHelper.createMeterChart(resultMap, paramMap, "k2_2_1_1_fee_meter_yoy_img");

			MakeJFreeChartImgParamHelper.makeMeterImgParamData(resultMap, paramMap, kpiQuotaLimitMap, new String[] {
					"环比", "k2_2_1_1_fee_mom_end", "KPI0001", "1", "k2_2_1_1_fee_mom_flag_end" });
			jFreeChartHelper.createMeterChart(resultMap, paramMap, "k2_2_1_1_fee_meter_mom_img");

			// 2、住院费用 趋势图
			paramMap.put("xyLine_chartDTO", new BaseChartDTO("住院医疗费用  趋势图(万元)", "1"));
			paramMap.put(
					"xyLine_chartDataDTO",
					RtfElementDataHelper.getInstance().createHospAOutpatFeeSeriesList(resultMap,
							KpiValueConst.WORD_PARTY_3, kpiBatchDTO.getKpiTime(), true));

			jFreeChartHelper.createXYLineChart(resultMap, paramMap, "k2_2_1_1_Fee_Rate_xyLine_img");

			// 3、住院费用 同比环比变化趋势图
			paramMap.put("xyLine_chartDTO", new BaseChartDTO("住院医疗费用  同比环比变化趋势图", "2"));
			paramMap.put(
					"xyLine_chartDataDTO",
					RtfElementDataHelper.getInstance().createHospMedYcSeriesList(resultMap, KpiValueConst.WORD_PARTY_3,
							kpiBatchDTO.getKpiTime(), true));

			jFreeChartHelper.createXYLineChart(resultMap, paramMap, "k2_2_1_1_Fee_yc_img");
		}
	}

	/**
	 * 杨理刚 住院：医保费用比值
	 * 
	 * @param resultMap
	 *            resultMap
	 * @param paramMap
	 *            paramMap
	 * @param kpiQuotaLimitMap
	 *            kpiQuotaLimitMap
	 * @param kpiBatchDTO
	 *            kpiBatchDTO
	 */
	@Override
	public void getRateMedFeeData(Map<String, Object> resultMap, Map<String, Object> paramMap,
			Map<String, Object> kpiQuotaLimitMap, KpiBatchDTO kpiBatchDTO) {
		Map<String, Object> hosMedToWord = wordReportService.getHosMedToWord(paramMap, kpiQuotaLimitMap);

		GeneralMethods.getInstance().addAllValueToMap(hosMedToWord, resultMap);

		if (KpiValueConst.WORD_PARTY_1.equals(paramMap.get("type"))) {
			// 住院費用的同比、生成同比环比
			MakeJFreeChartImgParamHelper.makeMeterImgParamData(resultMap, paramMap, kpiQuotaLimitMap, new String[] {
					"同比", "k0_2_1_2_f_yoy_end", "KPI0002", "0", "k0_2_1_2_f_yoy_flag_end" });
			jFreeChartHelper.createMeterChart(resultMap, paramMap, "k0_2_1_2_Fee_Rate_meter_yoy_img");

			// 1、 生成同比环比仪表盘
			MakeJFreeChartImgParamHelper.makeMeterImgParamData(resultMap, paramMap, kpiQuotaLimitMap, new String[] {
					"环比", "k0_2_1_2_f_mom_end", "KPI0002", "1", "k0_2_1_2_f_mom_flag_end" });
			jFreeChartHelper.createMeterChart(resultMap, paramMap, "k0_2_1_2_Fee_Rate_meter_mom_img");

			// 2、医保费用占比
			paramMap.put("xyLine_chartDTO", new BaseChartDTO("医保费用占比  趋势图", "2"));
			paramMap.put(
					"xyLine_chartDataDTO",
					RtfElementDataHelper.getInstance().createHospFeeRateSeriesList(resultMap,
							KpiValueConst.WORD_PARTY_1, kpiBatchDTO.getKpiTime(), true));

			jFreeChartHelper.createXYLineChart(resultMap, paramMap, "k0_2_1_2_Fee_Rate_xyLine_img");

			// 3、医保费用同比环比变化趋势图
			paramMap.put("xyLine_chartDTO", new BaseChartDTO("医保费用占比  同比环比变化趋势图", "2"));
			paramMap.put(
					"xyLine_chartDataDTO",
					RtfElementDataHelper.getInstance().createMedRateYcSeriesList(resultMap, KpiValueConst.WORD_PARTY_1,
							kpiBatchDTO.getKpiTime(), true));

			jFreeChartHelper.createXYLineChart(resultMap, paramMap, "k0_2_1_2_Fee_Rate_xyLine_yc_img");

		} else if (KpiValueConst.WORD_PARTY_3.equals(paramMap.get("type"))) {
			// 同比环比趋势图
			MakeJFreeChartImgParamHelper.makeMeterImgParamData(resultMap, paramMap, kpiQuotaLimitMap, new String[] {
					"同比", "k2_2_1_2_f_yoy_end", "KPI0002", "0", "k2_2_1_2_f_yoy_flag_end" });
			jFreeChartHelper.createMeterChart(resultMap, paramMap, "k2_2_1_2_Fee_Rate_meter_yoy_img");

			// 1、 生成同比环比仪表盘
			MakeJFreeChartImgParamHelper.makeMeterImgParamData(resultMap, paramMap, kpiQuotaLimitMap, new String[] {
					"环比", "k2_2_1_2_f_mom_end", "KPI0002", "1", "k2_2_1_2_f_mom_flag_end" });
			jFreeChartHelper.createMeterChart(resultMap, paramMap, "k2_2_1_2_Fee_Rate_meter_mom_img");

			// 2、住院费用 趋势图
			paramMap.put("xyLine_chartDTO", new BaseChartDTO("医保费用占比  趋势图", "2"));
			paramMap.put(
					"xyLine_chartDataDTO",
					RtfElementDataHelper.getInstance().createHospFeeRateSeriesList(resultMap,
							KpiValueConst.WORD_PARTY_3, kpiBatchDTO.getKpiTime(), true));

			jFreeChartHelper.createXYLineChart(resultMap, paramMap, "k2_2_1_2_Fee_Rate_xyLine_img");

			// 3、住院费用 同比环比变化趋势图
			paramMap.put("xyLine_chartDTO", new BaseChartDTO("医保费用占比  同比环比变化趋势图", "2"));
			paramMap.put(
					"xyLine_chartDataDTO",
					RtfElementDataHelper.getInstance().createMedRateYcSeriesList(resultMap, KpiValueConst.WORD_PARTY_3,
							kpiBatchDTO.getKpiTime(), true));

			jFreeChartHelper.createXYLineChart(resultMap, paramMap, "k2_2_1_2_Fee_Rate_xyLine_yc_img");
		}
	}

	/**
	 * 住院：药品费用
	 * 
	 * @param resultMap
	 *            resultMap
	 * @param paramMap
	 *            paramMap
	 * @param kpiQuotaLimitMap
	 *            kpiQuotaLimitMap
	 * @param kpiBatchDTO
	 *            kpiBatchDTO
	 */
	@Override
	public void getDrugFeeData(Map<String, Object> resultMap, Map<String, Object> paramMap,
			Map<String, Object> kpiQuotaLimitMap, KpiBatchDTO kpiBatchDTO) {
		if (KpiValueConst.WORD_PARTY_1.equals(paramMap.get("type"))) {
			Map<String, Object> hosFeeToWord = wordReportService.getHosMedicalFeeToWord(paramMap, kpiQuotaLimitMap);
			GeneralMethods.getInstance().addAllValueToMap(hosFeeToWord, resultMap);

			Map<String, Object> otherFeeMap = wordReportService.getHosOthersFeeToWord(paramMap, kpiQuotaLimitMap);
			GeneralMethods.getInstance().addAllValueToMap(otherFeeMap, resultMap);

			// 住院:药品費用的同比、环比仪表盘
			MakeJFreeChartImgParamHelper.makeMeterImgParamData(resultMap, paramMap, kpiQuotaLimitMap, new String[] {
					"同比", "k0_2_2_1_yoy_end", "KPI0053", "0", "k0_2_2_1_yoy_flag_end" });
			jFreeChartHelper.createMeterChart(resultMap, paramMap, "k0_2_2_1_fee_meter_yoy_img");

			MakeJFreeChartImgParamHelper.makeMeterImgParamData(resultMap, paramMap, kpiQuotaLimitMap, new String[] {
					"环比", "k0_2_2_1_mom_end", "KPI0053", "1", "k0_2_2_1_mom_flag_end" });
			jFreeChartHelper.createMeterChart(resultMap, paramMap, "k0_2_2_1_fee_meter_mom_img");

			// 2、第二部分住院药品占比的饼图
			paramMap.put("xyLine_chartDTO", new BaseChartDTO("住院药占比", "2"));
			paramMap.put(
					"xyLine_chartDataDTO",
					RtfElementDataHelper.getInstance().getDrugFeeRatePieSeriesList(resultMap,
							KpiValueConst.WORD_PARTY_1, kpiBatchDTO.getKpiTime(), true));

			jFreeChartHelper.createPieChartPic(resultMap, paramMap, "k0_2_2_1_Fee_Rate_pie_img",
					KpiValueConst.MEDIATE_PIC);

		} else if (KpiValueConst.WORD_PARTY_3.equals(paramMap.get("type"))) {
			// 住院费用
			Map<String, Object> drugFeeMap = wordReportService.getHosMedicalFeeToWordByOrg(paramMap, kpiQuotaLimitMap);
			GeneralMethods.getInstance().addAllValueToMap(drugFeeMap, resultMap);

			// 住院其他费用
			Map<String, Object> otherFeeMap = wordReportService.getHosOthersFeeToWordByOrg(paramMap, kpiQuotaLimitMap);
			GeneralMethods.getInstance().addAllValueToMap(otherFeeMap, resultMap);

			// 住院:药品費用的同比、环比仪表盘
			MakeJFreeChartImgParamHelper.makeMeterImgParamData(resultMap, paramMap, kpiQuotaLimitMap, new String[] {
					"同比", "k2_2_2_1_yoy_end", "KPI0053", "0", "k2_2_2_1_yoy_flag_end" });
			jFreeChartHelper.createMeterChart(resultMap, paramMap, "k2_2_2_1_fee_meter_yoy_img");

			MakeJFreeChartImgParamHelper.makeMeterImgParamData(resultMap, paramMap, kpiQuotaLimitMap, new String[] {
					"环比", "k2_2_2_1_mom_end", "KPI0053", "1", "k2_2_2_1_mom_flag_end" });
			jFreeChartHelper.createMeterChart(resultMap, paramMap, "k2_2_2_1_fee_meter_mom_img");

			// 2、第二部分住院药品占比的饼图
			paramMap.put("xyLine_chartDTO", new BaseChartDTO("住院药占比", "2"));
			paramMap.put(
					"xyLine_chartDataDTO",
					RtfElementDataHelper.getInstance().getDrugFeeRatePieSeriesList(resultMap,
							KpiValueConst.WORD_PARTY_3, kpiBatchDTO.getKpiTime(), true));

			jFreeChartHelper.createPieChartPic(resultMap, paramMap, "k2_2_2_1_Fee_Rate_pie_img",
					KpiValueConst.MEDIATE_PIC);
		}
	}

	/**
	 * 高海光 住院：其他费用
	 * 
	 * @param resultMap
	 *            resultMap
	 * @param paramMap
	 *            paramMap
	 * @param kpiQuotaLimitMap
	 *            kpiQuotaLimitMap
	 * @param kpiBatchDTO
	 *            kpiBatchDTO
	 */
	@SuppressWarnings("unchecked")
	@Override
	public void getOtherFeeData(Map<String, Object> resultMap, Map<String, Object> paramMap,
			Map<String, Object> kpiQuotaLimitMap, KpiBatchDTO kpiBatchDTO) {
		// 和上面方法合并了
		if (KpiValueConst.WORD_PARTY_1.equals(paramMap.get("type"))) {

			// 2、 门诊:其他费用同比环比仪表盘
			MakeJFreeChartImgParamHelper.makeMeterImgParamData(resultMap, paramMap, kpiQuotaLimitMap, new String[] {
					"同比", "k0_2_2_2_yoy_end", "KPI0070", "0", "k0_2_2_2_yoy_flag_end" });
			jFreeChartHelper.createMeterChart(resultMap, paramMap, "k0_2_2_2_fee_meter_yoy_img");

			MakeJFreeChartImgParamHelper.makeMeterImgParamData(resultMap, paramMap, kpiQuotaLimitMap, new String[] {
					"环比", "k0_2_2_2_mom_end", "KPI0070", "1", "k0_2_2_2_mom_flag_end" });
			jFreeChartHelper.createMeterChart(resultMap, paramMap, "k0_2_2_2_fee_meter_mom_img");

			// TODO 其他费用table k0_2_2_2_fee_table
			Table table = CreateRtfTableDataHelper.getInstance().crateDrugOtherFeeTable(
					(List<String[]>) resultMap.get("k0_2_2_2_fee_tableList_end"), " 本 期 金 额    (万 元 )");

			resultMap.put("k0_2_2_2_fee_table",
					CreateRtfTableDataHelper.getInstance().getTableStr(table, rtfReportTemplatePath));

			// 4、第三部分其他费用占比的饼图
			paramMap.put("xyLine_chartDTO", new BaseChartDTO("住院费用分布图（除药费外）", "1"));
			paramMap.put(
					"xyLine_chartDataDTO",
					RtfElementDataHelper.getInstance().getOtherFeeRatePieSeriesList(resultMap,
							KpiValueConst.WORD_PARTY_1, kpiBatchDTO.getKpiTime(), true));

			jFreeChartHelper.createPieChartPic(resultMap, paramMap, "k0_2_2_2_fee_pie_img");

			// 1、检查费
			paramMap.put("xyLine_chartDTO", new BaseChartDTO("住院检查费 变化趋势图(万元)", "1"));
			paramMap.put(
					"xyLine_chartDataDTO",
					RtfElementDataHelper.getInstance().createDrugOtherFeeSeriesList(resultMap,
							KpiValueConst.WORD_PARTY_1, kpiBatchDTO.getKpiTime(), true, "2"));
			jFreeChartHelper.createXYLineChart(resultMap, paramMap, "k0_2_2_2_fee_xyLine_zy_img");

			paramMap.put("xyLine_chartDTO", new BaseChartDTO("住院检查费 同比环比变化趋势图", "2"));
			paramMap.put(
					"xyLine_chartDataDTO",
					RtfElementDataHelper.getInstance().createDrugOtherFeeYoyMomSeriesList(resultMap,
							KpiValueConst.WORD_PARTY_1, kpiBatchDTO.getKpiTime(), true, "2"));

			jFreeChartHelper.createXYLineChart(resultMap, paramMap, "k0_2_2_2_fee_xyLine_zy_yc_img");

			// 2、手术费
			paramMap.put("xyLine_chartDTO", new BaseChartDTO("住院手术费 变化趋势图(万元)", "1"));
			paramMap.put(
					"xyLine_chartDataDTO",
					RtfElementDataHelper.getInstance().createDrugOtherFeeSeriesList(resultMap,
							KpiValueConst.WORD_PARTY_1, kpiBatchDTO.getKpiTime(), true, "25"));
			jFreeChartHelper.createXYLineChart(resultMap, paramMap, "k0_2_2_25_fee_xyLine_zy_img");

			paramMap.put("xyLine_chartDTO", new BaseChartDTO("住院手术费 同比环比变化趋势图", "2"));
			paramMap.put(
					"xyLine_chartDataDTO",
					RtfElementDataHelper.getInstance().createDrugOtherFeeYoyMomSeriesList(resultMap,
							KpiValueConst.WORD_PARTY_1, kpiBatchDTO.getKpiTime(), true, "25"));

			jFreeChartHelper.createXYLineChart(resultMap, paramMap, "k0_2_2_25_fee_xyLine_zy_yc_img");

			// 3、治疗费
			paramMap.put("xyLine_chartDTO", new BaseChartDTO("住院治疗费 变化趋势图(万元)", "1"));
			paramMap.put(
					"xyLine_chartDataDTO",
					RtfElementDataHelper.getInstance().createDrugOtherFeeSeriesList(resultMap,
							KpiValueConst.WORD_PARTY_1, kpiBatchDTO.getKpiTime(), true, "30"));
			jFreeChartHelper.createXYLineChart(resultMap, paramMap, "k0_2_2_30_fee_xyLine_zy_img");

			paramMap.put("xyLine_chartDTO", new BaseChartDTO("住院治疗费 同比环比变化趋势图", "2"));
			paramMap.put(
					"xyLine_chartDataDTO",
					RtfElementDataHelper.getInstance().createDrugOtherFeeYoyMomSeriesList(resultMap,
							KpiValueConst.WORD_PARTY_1, kpiBatchDTO.getKpiTime(), true, "30"));

			jFreeChartHelper.createXYLineChart(resultMap, paramMap, "k0_2_2_30_fee_xyLine_zy_yc_img");

			// 4、化验费
			paramMap.put("xyLine_chartDTO", new BaseChartDTO("住院化验费 变化趋势图(万元)", "1"));
			paramMap.put(
					"xyLine_chartDataDTO",
					RtfElementDataHelper.getInstance().createDrugOtherFeeSeriesList(resultMap,
							KpiValueConst.WORD_PARTY_1, kpiBatchDTO.getKpiTime(), true, "32"));
			jFreeChartHelper.createXYLineChart(resultMap, paramMap, "k0_2_2_32_fee_xyLine_zy_img");

			paramMap.put("xyLine_chartDTO", new BaseChartDTO("住院化验费 同比环比变化趋势图", "2"));
			paramMap.put(
					"xyLine_chartDataDTO",
					RtfElementDataHelper.getInstance().createDrugOtherFeeYoyMomSeriesList(resultMap,
							KpiValueConst.WORD_PARTY_1, kpiBatchDTO.getKpiTime(), true, "32"));

			jFreeChartHelper.createXYLineChart(resultMap, paramMap, "k0_2_2_32_fee_xyLine_zy_yc_img");

			// 5、其他费 KPI0035
			paramMap.put("xyLine_chartDTO", new BaseChartDTO("住院其他费 变化趋势图(万元)", "1"));
			paramMap.put(
					"xyLine_chartDataDTO",
					RtfElementDataHelper.getInstance().createDrugOtherFeeSeriesList(resultMap,
							KpiValueConst.WORD_PARTY_1, kpiBatchDTO.getKpiTime(), true, "35"));
			jFreeChartHelper.createXYLineChart(resultMap, paramMap, "k0_2_2_35_fee_xyLine_zy_img");

			paramMap.put("xyLine_chartDTO", new BaseChartDTO("住院其他费 同比环比变化趋势图", "2"));
			paramMap.put(
					"xyLine_chartDataDTO",
					RtfElementDataHelper.getInstance().createDrugOtherFeeYoyMomSeriesList(resultMap,
							KpiValueConst.WORD_PARTY_1, kpiBatchDTO.getKpiTime(), true, "35"));

			jFreeChartHelper.createXYLineChart(resultMap, paramMap, "k0_2_2_35_fee_xyLine_zy_yc_img");

			// 6、其余费 KPI0069
			paramMap.put("xyLine_chartDTO", new BaseChartDTO("住院其余费 变化趋势图(万元)", "1"));
			paramMap.put(
					"xyLine_chartDataDTO",
					RtfElementDataHelper.getInstance().createDrugOtherFeeSeriesList(resultMap,
							KpiValueConst.WORD_PARTY_1, kpiBatchDTO.getKpiTime(), true, "69"));
			jFreeChartHelper.createXYLineChart(resultMap, paramMap, "k0_2_2_69_fee_xyLine_zy_img");

			paramMap.put("xyLine_chartDTO", new BaseChartDTO("住院其余费 同比环比变化趋势图", "2"));
			paramMap.put(
					"xyLine_chartDataDTO",
					RtfElementDataHelper.getInstance().createDrugOtherFeeYoyMomSeriesList(resultMap,
							KpiValueConst.WORD_PARTY_1, kpiBatchDTO.getKpiTime(), true, "69"));

			jFreeChartHelper.createXYLineChart(resultMap, paramMap, "k0_2_2_69_fee_xyLine_zy_yc_img");

		} else if (KpiValueConst.WORD_PARTY_3.equals(paramMap.get("type"))) {
			// 2、 门诊:其他费用同比环比仪表盘
			MakeJFreeChartImgParamHelper.makeMeterImgParamData(resultMap, paramMap, kpiQuotaLimitMap, new String[] {
					"同比", "k2_2_2_2_yoy_end", "KPI0070", "0", "k2_2_2_2_yoy_flag_end" });
			jFreeChartHelper.createMeterChart(resultMap, paramMap, "k2_2_2_2_fee_meter_yoy_img");

			MakeJFreeChartImgParamHelper.makeMeterImgParamData(resultMap, paramMap, kpiQuotaLimitMap, new String[] {
					"环比", "k2_2_2_2_mom_end", "KPI0070", "1", "k2_2_2_2_mom_flag_end" });
			jFreeChartHelper.createMeterChart(resultMap, paramMap, "k2_2_2_2_fee_meter_mom_img");

			// 其他费用table
			Table table = CreateRtfTableDataHelper.getInstance().crateDrugOtherFeeTable(
					(List<String[]>) resultMap.get("k2_2_2_2_fee_tableList_end"), " 本 期 金 额    (万 元 )");

			resultMap.put("k2_2_2_2_fee_table",
					CreateRtfTableDataHelper.getInstance().getTableStr(table, rtfReportTemplatePath));

			// 4、第三部分其他费用占比的饼图
			paramMap.put("xyLine_chartDTO", new BaseChartDTO("住院费用分布图(除药费外)", "1"));
			paramMap.put(
					"xyLine_chartDataDTO",
					RtfElementDataHelper.getInstance().getOtherFeeRatePieSeriesList(resultMap,
							KpiValueConst.WORD_PARTY_3, kpiBatchDTO.getKpiTime(), true));

			jFreeChartHelper.createPieChartPic(resultMap, paramMap, "k2_2_2_2_fee_pie_img");

			// 1、检查费
			paramMap.put("xyLine_chartDTO", new BaseChartDTO("住院检查费 变化趋势图(万元)", "1"));
			paramMap.put(
					"xyLine_chartDataDTO",
					RtfElementDataHelper.getInstance().createDrugOtherFeeSeriesList(resultMap,
							KpiValueConst.WORD_PARTY_3, kpiBatchDTO.getKpiTime(), true, "2"));
			jFreeChartHelper.createXYLineChart(resultMap, paramMap, "k2_2_2_2_fee_xyLine_zy_img");

			paramMap.put("xyLine_chartDTO", new BaseChartDTO("住院检查费 同比环比变化趋势图", "2"));
			paramMap.put(
					"xyLine_chartDataDTO",
					RtfElementDataHelper.getInstance().createDrugOtherFeeYoyMomSeriesList(resultMap,
							KpiValueConst.WORD_PARTY_3, kpiBatchDTO.getKpiTime(), true, "2"));

			jFreeChartHelper.createXYLineChart(resultMap, paramMap, "k2_2_2_2_fee_xyLine_zy_yc_img");

			// 2、手术费
			paramMap.put("xyLine_chartDTO", new BaseChartDTO("住院手术费 变化趋势图(万元)", "1"));
			paramMap.put(
					"xyLine_chartDataDTO",
					RtfElementDataHelper.getInstance().createDrugOtherFeeSeriesList(resultMap,
							KpiValueConst.WORD_PARTY_3, kpiBatchDTO.getKpiTime(), true, "25"));
			jFreeChartHelper.createXYLineChart(resultMap, paramMap, "k2_2_2_25_fee_xyLine_zy_img");

			paramMap.put("xyLine_chartDTO", new BaseChartDTO("住院手术费 同比环比变化趋势图", "2"));
			paramMap.put(
					"xyLine_chartDataDTO",
					RtfElementDataHelper.getInstance().createDrugOtherFeeYoyMomSeriesList(resultMap,
							KpiValueConst.WORD_PARTY_3, kpiBatchDTO.getKpiTime(), true, "25"));

			jFreeChartHelper.createXYLineChart(resultMap, paramMap, "k2_2_2_25_fee_xyLine_zy_yc_img");

			// 3、治疗费
			paramMap.put("xyLine_chartDTO", new BaseChartDTO("住院治疗费 变化趋势图(万元)", "1"));
			paramMap.put(
					"xyLine_chartDataDTO",
					RtfElementDataHelper.getInstance().createDrugOtherFeeSeriesList(resultMap,
							KpiValueConst.WORD_PARTY_3, kpiBatchDTO.getKpiTime(), true, "30"));
			jFreeChartHelper.createXYLineChart(resultMap, paramMap, "k2_2_2_30_fee_xyLine_zy_img");

			paramMap.put("xyLine_chartDTO", new BaseChartDTO("住院治疗费 同比环比变化趋势图", "2"));
			paramMap.put(
					"xyLine_chartDataDTO",
					RtfElementDataHelper.getInstance().createDrugOtherFeeYoyMomSeriesList(resultMap,
							KpiValueConst.WORD_PARTY_3, kpiBatchDTO.getKpiTime(), true, "30"));

			jFreeChartHelper.createXYLineChart(resultMap, paramMap, "k2_2_2_30_fee_xyLine_zy_yc_img");

			// 4、化验费
			paramMap.put("xyLine_chartDTO", new BaseChartDTO("住院化验费 变化趋势图(万元)", "1"));
			paramMap.put(
					"xyLine_chartDataDTO",
					RtfElementDataHelper.getInstance().createDrugOtherFeeSeriesList(resultMap,
							KpiValueConst.WORD_PARTY_3, kpiBatchDTO.getKpiTime(), true, "32"));
			jFreeChartHelper.createXYLineChart(resultMap, paramMap, "k2_2_2_32_fee_xyLine_zy_img");

			paramMap.put("xyLine_chartDTO", new BaseChartDTO("住院化验费 同比环比变化趋势图", "2"));
			paramMap.put(
					"xyLine_chartDataDTO",
					RtfElementDataHelper.getInstance().createDrugOtherFeeYoyMomSeriesList(resultMap,
							KpiValueConst.WORD_PARTY_3, kpiBatchDTO.getKpiTime(), true, "32"));

			jFreeChartHelper.createXYLineChart(resultMap, paramMap, "k2_2_2_32_fee_xyLine_zy_yc_img");

			// 5、其他费 KPI0035
			paramMap.put("xyLine_chartDTO", new BaseChartDTO("住院其他费 变化趋势图(万元)", "1"));
			paramMap.put(
					"xyLine_chartDataDTO",
					RtfElementDataHelper.getInstance().createDrugOtherFeeSeriesList(resultMap,
							KpiValueConst.WORD_PARTY_3, kpiBatchDTO.getKpiTime(), true, "35"));
			jFreeChartHelper.createXYLineChart(resultMap, paramMap, "k2_2_2_35_fee_xyLine_zy_img");

			paramMap.put("xyLine_chartDTO", new BaseChartDTO("住院其他费 同比环比变化趋势图", "2"));
			paramMap.put(
					"xyLine_chartDataDTO",
					RtfElementDataHelper.getInstance().createDrugOtherFeeYoyMomSeriesList(resultMap,
							KpiValueConst.WORD_PARTY_3, kpiBatchDTO.getKpiTime(), true, "35"));

			jFreeChartHelper.createXYLineChart(resultMap, paramMap, "k2_2_2_35_fee_xyLine_zy_yc_img");

			// 6、其余费 KPI0069
			paramMap.put("xyLine_chartDTO", new BaseChartDTO("住院其余费 变化趋势图(万元)", "1"));
			paramMap.put(
					"xyLine_chartDataDTO",
					RtfElementDataHelper.getInstance().createDrugOtherFeeSeriesList(resultMap,
							KpiValueConst.WORD_PARTY_3, kpiBatchDTO.getKpiTime(), true, "69"));
			jFreeChartHelper.createXYLineChart(resultMap, paramMap, "k2_2_2_69_fee_xyLine_zy_img");

			paramMap.put("xyLine_chartDTO", new BaseChartDTO("住院其余费 同比环比变化趋势图", "2"));
			paramMap.put(
					"xyLine_chartDataDTO",
					RtfElementDataHelper.getInstance().createDrugOtherFeeYoyMomSeriesList(resultMap,
							KpiValueConst.WORD_PARTY_3, kpiBatchDTO.getKpiTime(), true, "69"));

			jFreeChartHelper.createXYLineChart(resultMap, paramMap, "k2_2_2_69_fee_xyLine_zy_yc_img");
		}
	}

	/**
	 * 张纪成 住院：出院人次
	 * 
	 * @param resultMap
	 *            resultMap
	 * @param paramMap
	 *            paramMap
	 * @param kpiQuotaLimitMap
	 *            kpiQuotaLimitMap
	 * @param kpiBatchDTO
	 *            kpiBatchDTO
	 */
	@Override
	public void getDischargePeoplesData(Map<String, Object> resultMap, Map<String, Object> paramMap,
			Map<String, Object> kpiQuotaLimitMap, KpiBatchDTO kpiBatchDTO) {
		Map<String, Object> totalPersonHospNumInfo = wordReportService.getTotalPersonHospNumInfo(paramMap,
				kpiQuotaLimitMap);

		GeneralMethods.getInstance().addAllValueToMap(totalPersonHospNumInfo, resultMap);

		if (KpiValueConst.WORD_PARTY_1.equals(paramMap.get("type"))) {
			MakeJFreeChartImgParamHelper.makeMeterImgParamData(resultMap, paramMap, kpiQuotaLimitMap, new String[] {
					"同比", "k0_2_3_1_yoy_end", "KPI0010", "0", "k0_2_3_1_yoy_flag_end" });
			jFreeChartHelper.createMeterChart(resultMap, paramMap, "k0_2_3_1_times_meter_yoy_img");

			MakeJFreeChartImgParamHelper.makeMeterImgParamData(resultMap, paramMap, kpiQuotaLimitMap, new String[] {
					"环比", "k0_2_3_1_mom_end", "KPI0010", "1", "k0_2_3_1_mom_flag_end" });
			jFreeChartHelper.createMeterChart(resultMap, paramMap, "k0_2_3_1_times_meter_mom_img");

		} else if (KpiValueConst.WORD_PARTY_3.equals(paramMap.get("type"))) {
			MakeJFreeChartImgParamHelper.makeMeterImgParamData(resultMap, paramMap, kpiQuotaLimitMap, new String[] {
					"同比", "k2_2_3_1_yoy_end", "KPI0010", "0", "k2_2_3_1_yoy_flag_end" });
			jFreeChartHelper.createMeterChart(resultMap, paramMap, "k2_2_3_1_times_meter_yoy_img");

			MakeJFreeChartImgParamHelper.makeMeterImgParamData(resultMap, paramMap, kpiQuotaLimitMap, new String[] {
					"环比", "k2_2_3_1_mom_end", "KPI0010", "1", "k2_2_3_1_mom_flag_end" });
			jFreeChartHelper.createMeterChart(resultMap, paramMap, "k2_2_3_1_times_meter_mom_img");
		}
	}

	/**
	 * TODO 张纪成 出院人次和次均费用 出院人次 变化趋势图 出院人次 同比环比变化趋势图 次均费用 lang.String)
	 * 
	 * @param resultMap
	 *            resultMap
	 * @param paramMap
	 *            paramMap
	 * @param kpiQuotaLimitMap
	 *            kpiQuotaLimitMap
	 * @param kpiBatchDTO
	 *            kpiBatchDTO
	 */
	@Override
	public void getTimesCostData(Map<String, Object> resultMap, Map<String, Object> paramMap,
			Map<String, Object> kpiQuotaLimitMap, KpiBatchDTO kpiBatchDTO) {
		Map<String, Object> totalPersonHospNumInfo = wordReportService.getTotalPersonHospNumAverageFee(paramMap,
				kpiQuotaLimitMap);

		GeneralMethods.getInstance().addAllValueToMap(totalPersonHospNumInfo, resultMap);

		if (KpiValueConst.WORD_PARTY_1.equals(paramMap.get("type"))) {
			MakeJFreeChartImgParamHelper.makeMeterImgParamData(resultMap, paramMap, kpiQuotaLimitMap, new String[] {
					"同比", "k0_2_3_2_yoy_end", "KPI0004", "0", "k0_2_3_2_yoy_flag_end" });
			jFreeChartHelper.createMeterChart(resultMap, paramMap, "k0_2_3_2_fee_meter_yoy_img");

			MakeJFreeChartImgParamHelper.makeMeterImgParamData(resultMap, paramMap, kpiQuotaLimitMap, new String[] {
					"环比", "k0_2_3_2_mom_end", "KPI0004", "1", "k0_2_3_2_mom_flag_end" });
			jFreeChartHelper.createMeterChart(resultMap, paramMap, "k0_2_3_2_fee_meter_mom_img");

			// k0_2_3_2_fh_xyLine_img
			paramMap.put("xyLine_chartDTO", new BaseChartDTO("出院人次和次均费用", "1", GeneralMethods.getInstance()
					.reversalStr("次均费用)元("), "出院人次(人次)"));
			paramMap.put(
					"xyLine_chartDataDTO",
					RtfElementDataHelper.getInstance().createCyCjSeriesList(resultMap, KpiValueConst.WORD_PARTY_1,
							kpiBatchDTO.getKpiTime(), true));
			jFreeChartHelper.createCombinedChart(resultMap, paramMap, "k0_2_3_2_fh_xyLine_img");

			paramMap.put("xyLine_chartDTO", new BaseChartDTO("出院人次  变化趋势图(人次)", "1"));
			paramMap.put(
					"xyLine_chartDataDTO",
					RtfElementDataHelper.getInstance().createCyRcSeriesList(resultMap, KpiValueConst.WORD_PARTY_1,
							kpiBatchDTO.getKpiTime(), true));

			jFreeChartHelper.createXYLineChart(resultMap, paramMap, "k0_2_3_2_cy_xyLine_img");

			// 住院检查费 同比环比变化趋势图
			paramMap.put("xyLine_chartDTO", new BaseChartDTO("出院人次  同比环比变化趋势图", "2"));
			paramMap.put(
					"xyLine_chartDataDTO",
					RtfElementDataHelper.getInstance().createCyYcSeriesList(resultMap, KpiValueConst.WORD_PARTY_1,
							kpiBatchDTO.getKpiTime(), true));

			jFreeChartHelper.createXYLineChart(resultMap, paramMap, "k0_2_3_2_cy_ycLine_img");

			// 次均费用
			paramMap.put("xyLine_chartDTO", new BaseChartDTO("次均费用  变化趋势图(元)", "1"));
			paramMap.put(
					"xyLine_chartDataDTO",
					RtfElementDataHelper.getInstance().createCjFeeSeriesList(resultMap, KpiValueConst.WORD_PARTY_1,
							kpiBatchDTO.getKpiTime(), true));
			jFreeChartHelper.createXYLineChart(resultMap, paramMap, "k0_2_3_2_cj_xyLine_img");

			paramMap.put("xyLine_chartDTO", new BaseChartDTO("次均费用  同比环比变化趋势图", "2"));
			paramMap.put(
					"xyLine_chartDataDTO",
					RtfElementDataHelper.getInstance().createCjYcSeriesList(resultMap, KpiValueConst.WORD_PARTY_1,
							kpiBatchDTO.getKpiTime(), true));

			jFreeChartHelper.createXYLineChart(resultMap, paramMap, "k0_2_3_2_cj_ycLine_img");

		} else if (KpiValueConst.WORD_PARTY_3.equals(paramMap.get("type"))) {
			MakeJFreeChartImgParamHelper.makeMeterImgParamData(resultMap, paramMap, kpiQuotaLimitMap, new String[] {
					"同比", "k2_2_3_2_yoy_end", "KPI0004", "0", "k2_2_3_2_yoy_flag_end" });
			jFreeChartHelper.createMeterChart(resultMap, paramMap, "k2_2_3_2_fee_meter_yoy_img");

			MakeJFreeChartImgParamHelper.makeMeterImgParamData(resultMap, paramMap, kpiQuotaLimitMap, new String[] {
					"环比", "k2_2_3_2_mom_end", "KPI0004", "1", "k2_2_3_2_mom_flag_end" });
			jFreeChartHelper.createMeterChart(resultMap, paramMap, "k2_2_3_2_fee_meter_mom_img");

			// 出院人次和次均费用
			paramMap.put("xyLine_chartDTO", new BaseChartDTO("出院人次和次均费用", "1", GeneralMethods.getInstance()
					.reversalStr("次均费用)元("), "出院人次(人次)"));
			paramMap.put(
					"xyLine_chartDataDTO",
					RtfElementDataHelper.getInstance().createCyCjSeriesList(resultMap, KpiValueConst.WORD_PARTY_3,
							kpiBatchDTO.getKpiTime(), true));
			jFreeChartHelper.createCombinedChart(resultMap, paramMap, "k2_2_3_2_fh_xyLine_img");

			paramMap.put("xyLine_chartDTO", new BaseChartDTO("出院人次  变化趋势图(人次)", "1"));
			paramMap.put(
					"xyLine_chartDataDTO",
					RtfElementDataHelper.getInstance().createCyRcSeriesList(resultMap, KpiValueConst.WORD_PARTY_3,
							kpiBatchDTO.getKpiTime(), true));

			jFreeChartHelper.createXYLineChart(resultMap, paramMap, "k2_2_3_2_cy_xyLine_img");

			// 住院检查费 同比环比变化趋势图
			paramMap.put("xyLine_chartDTO", new BaseChartDTO("出院人次  同比环比变化趋势图", "2"));
			paramMap.put(
					"xyLine_chartDataDTO",
					RtfElementDataHelper.getInstance().createCyYcSeriesList(resultMap, KpiValueConst.WORD_PARTY_3,
							kpiBatchDTO.getKpiTime(), true));

			jFreeChartHelper.createXYLineChart(resultMap, paramMap, "k2_2_3_2_cy_ycLine_img");

			// 次均费用
			paramMap.put("xyLine_chartDTO", new BaseChartDTO("次均费用  变化趋势图(元)", "1"));
			paramMap.put(
					"xyLine_chartDataDTO",
					RtfElementDataHelper.getInstance().createCjFeeSeriesList(resultMap, KpiValueConst.WORD_PARTY_3,
							kpiBatchDTO.getKpiTime(), true));

			jFreeChartHelper.createXYLineChart(resultMap, paramMap, "k2_2_3_2_cj_xyLine_img");

			// 住院检查费 同比环比变化趋势图
			paramMap.put("xyLine_chartDTO", new BaseChartDTO("次均费用  同比环比变化趋势图", "2"));
			paramMap.put(
					"xyLine_chartDataDTO",
					RtfElementDataHelper.getInstance().createCjYcSeriesList(resultMap, KpiValueConst.WORD_PARTY_3,
							kpiBatchDTO.getKpiTime(), true));

			jFreeChartHelper.createXYLineChart(resultMap, paramMap, "k2_2_3_2_cj_ycLine_img");
		}
	}

	// ---------------郑超 begin --------------------------------
	/**
	 * 平均住院天数/每床日费用
	 * 
	 * @param resultMap
	 *            resultMap
	 * @param paramMap
	 *            paramMap
	 * @param kpiQuotaLimitMap
	 *            kpiQuotaLimitMap
	 * @param kpiBatchDTO
	 *            kpiBatchDTO
	 */
	@Override
	public void getAvgHospBedDayData(Map<String, Object> resultMap, Map<String, Object> paramMap,
			Map<String, Object> kpiQuotaLimitMap, KpiBatchDTO kpiBatchDTO) {

		if (KpiValueConst.WORD_PARTY_1.equals(paramMap.get("type"))) {
			// 总体情况:平均住院天数/每床日费用
			paramMap.put("visitType", KpiValueConst.VISIT_TYP_HOSP);
			Map<String, Object> queryKpiData = wordReportService.queryKpiData(paramMap, kpiQuotaLimitMap);

			GeneralMethods.getInstance().addAllValueToMap(queryKpiData, resultMap);

			Map<String, Object> queryYearKpiData = wordReportService.queryYearKpiData(paramMap);
			GeneralMethods.getInstance().addAllValueToMap(queryYearKpiData, resultMap);

			// 平均住院天数
			MakeJFreeChartImgParamHelper.makeMeterImgParamData(resultMap, paramMap, kpiQuotaLimitMap, new String[] {
					"同比", "k0_2_4_1_yoy_end", "KPI0006", "0", "k0_2_4_1_yoy_flag_end" });
			jFreeChartHelper.createMeterChart(resultMap, paramMap, "k0_2_4_1_days_meter_yoy_img");

			MakeJFreeChartImgParamHelper.makeMeterImgParamData(resultMap, paramMap, kpiQuotaLimitMap, new String[] {
					"环比", "k0_2_4_1_mom_end", "KPI0006", "1", "k0_2_4_1_mom_flag_end" });
			jFreeChartHelper.createMeterChart(resultMap, paramMap, "k0_2_4_1_days_meter_mom_img");

			MakeJFreeChartImgParamHelper.makeMeterImgParamData(resultMap, paramMap, kpiQuotaLimitMap, new String[] {
					"同比", "k0_2_4_2_yoy_end", "KPI0007", "0", "k0_2_4_2_yoy_flag_end" });
			jFreeChartHelper.createMeterChart(resultMap, paramMap, "k0_2_4_2_fee_meter_yoy_img");

			MakeJFreeChartImgParamHelper.makeMeterImgParamData(resultMap, paramMap, kpiQuotaLimitMap, new String[] {
					"环比", "k0_2_4_2_fee_mom_end", "KPI0007", "1", "k0_2_4_2_fee_mom_flag_end" });
			jFreeChartHelper.createMeterChart(resultMap, paramMap, "k0_2_4_2_fee_meter_mom_img");

			// 平均住院日和平均床日费 k0_2_4_2_fee_xyLine_img k0_2_4_2_fee_zyList
			// k0_2_4_2_fee_crList
			paramMap.put("xyLine_chartDTO", new BaseChartDTO("平均住院日和平均床日费", "1", GeneralMethods.getInstance()
					.reversalStr("平均床日费)元("), "平均住院日（天）"));
			paramMap.put(
					"xyLine_chartDataDTO",
					RtfElementDataHelper.getInstance().createAvgHospDayAndBedFeeSeriesList(resultMap,
							KpiValueConst.WORD_PARTY_1, kpiBatchDTO.getKpiTime(), true));

			// 生成医保占比预测趋势图
			jFreeChartHelper.createCombinedChart(resultMap, paramMap, "k0_2_4_2_fee_xyLine_img");

			// 1、平均住院日 变化趋势图(天)
			paramMap.put("xyLine_chartDTO", new BaseChartDTO("平均住院日  变化趋势图(天)", "1"));
			paramMap.put(
					"xyLine_chartDataDTO",
					RtfElementDataHelper.getInstance().createZyRiYearSeriesList(resultMap, KpiValueConst.WORD_PARTY_1,
							kpiBatchDTO.getKpiTime(), true, false));

			jFreeChartHelper.createXYLineChart(resultMap, paramMap, "k0_2_4_2_zy_xyLine_img");

			// 2、平均住院日 同比环比变化趋势图
			paramMap.put("xyLine_chartDTO", new BaseChartDTO("平均住院日  同比环比变化趋势图", "2"));
			paramMap.put(
					"xyLine_chartDataDTO",
					RtfElementDataHelper.getInstance().createZyRiYoyMomSeriesList(resultMap,
							KpiValueConst.WORD_PARTY_1, kpiBatchDTO.getKpiTime(), true, false));

			jFreeChartHelper.createXYLineChart(resultMap, paramMap, "k0_2_4_2_zy_yc_xyLine_img");

			// 3、平均床日费 变化趋势图(天)
			paramMap.put("xyLine_chartDTO", new BaseChartDTO("平均床日费  变化趋势图(元)", "1"));
			paramMap.put(
					"xyLine_chartDataDTO",
					RtfElementDataHelper.getInstance().createZyRiYearSeriesList(resultMap, KpiValueConst.WORD_PARTY_1,
							kpiBatchDTO.getKpiTime(), true, true));

			jFreeChartHelper.createXYLineChart(resultMap, paramMap, "k0_2_4_2_cr_xyLine_img");

			// 4、平均床日费 变化趋势图(天)
			paramMap.put("xyLine_chartDTO", new BaseChartDTO("平均床日费  同比环比变化趋势图", "2"));
			paramMap.put(
					"xyLine_chartDataDTO",
					RtfElementDataHelper.getInstance().createZyRiYoyMomSeriesList(resultMap,
							KpiValueConst.WORD_PARTY_1, kpiBatchDTO.getKpiTime(), true, true));

			jFreeChartHelper.createXYLineChart(resultMap, paramMap, "k0_2_4_2_cr_yc_xyLine_img");

		} else if (KpiValueConst.WORD_PARTY_3.equals(paramMap.get("type"))) {

			// 单一机构的:平均住院天数/每床日费用
			paramMap.put("visitType", KpiValueConst.VISIT_TYP_HOSP);
			Map<String, Object> queryKpiData = wordReportService.queryOneOrgData(paramMap, kpiQuotaLimitMap);
			GeneralMethods.getInstance().addAllValueToMap(queryKpiData, resultMap);

			// 第三部分住院：平均住院日和平均床日费
			Map<String, Object> queryYearKpiData = wordReportService.queryOneOrgYearData(paramMap);
			GeneralMethods.getInstance().addAllValueToMap(queryYearKpiData, resultMap);

			// 平均住院天数
			MakeJFreeChartImgParamHelper.makeMeterImgParamData(resultMap, paramMap, kpiQuotaLimitMap, new String[] {
					"同比", "k2_2_4_1_yoy_end", "KPI0006", "0", "k2_2_4_1_yoy_flag_end" });
			jFreeChartHelper.createMeterChart(resultMap, paramMap, "k2_2_4_1_days_meter_yoy_img");

			MakeJFreeChartImgParamHelper.makeMeterImgParamData(resultMap, paramMap, kpiQuotaLimitMap, new String[] {
					"环比", "k2_2_4_1_mom_end", "KPI0006", "1", "k2_2_4_1_mom_flag_end" });
			jFreeChartHelper.createMeterChart(resultMap, paramMap, "k2_2_4_1_days_meter_mom_img");

			MakeJFreeChartImgParamHelper.makeMeterImgParamData(resultMap, paramMap, kpiQuotaLimitMap, new String[] {
					"同比", "k2_2_4_2_yoy_end", "KPI0007", "0", "k2_2_4_2_yoy_flag_end" });
			jFreeChartHelper.createMeterChart(resultMap, paramMap, "k2_2_4_2_fee_meter_yoy_img");

			MakeJFreeChartImgParamHelper.makeMeterImgParamData(resultMap, paramMap, kpiQuotaLimitMap, new String[] {
					"环比", "k2_2_4_2_fee_mom_end", "KPI0007", "1", "k2_2_4_2_fee_mom_flag_end" });
			jFreeChartHelper.createMeterChart(resultMap, paramMap, "k2_2_4_2_fee_meter_mom_img");

			// 平均住院日和平均床日费 k2_2_4_2_fee_xyLine_img
			paramMap.put("xyLine_chartDTO", new BaseChartDTO("平均住院日和平均床日费", "1", GeneralMethods.getInstance()
					.reversalStr("平均床日费)元("), "平均住院日（天）"));
			paramMap.put(
					"xyLine_chartDataDTO",
					RtfElementDataHelper.getInstance().createAvgHospDayAndBedFeeSeriesList(resultMap,
							KpiValueConst.WORD_PARTY_3, kpiBatchDTO.getKpiTime(), true));

			jFreeChartHelper.createCombinedChart(resultMap, paramMap, "k2_2_4_2_fee_xyLine_img");

			// 1、平均住院日 变化趋势图(天)
			paramMap.put("xyLine_chartDTO", new BaseChartDTO("平均住院日  变化趋势图(天)", "1"));
			paramMap.put(
					"xyLine_chartDataDTO",
					RtfElementDataHelper.getInstance().createZyRiYearSeriesList(resultMap, KpiValueConst.WORD_PARTY_3,
							kpiBatchDTO.getKpiTime(), true, false));

			jFreeChartHelper.createXYLineChart(resultMap, paramMap, "k2_2_4_2_zy_xyLine_img");

			// 2、平均住院日 同比环比变化趋势图
			paramMap.put("xyLine_chartDTO", new BaseChartDTO("平均住院日  同比环比变化趋势图", "2"));
			paramMap.put(
					"xyLine_chartDataDTO",
					RtfElementDataHelper.getInstance().createZyRiYoyMomSeriesList(resultMap,
							KpiValueConst.WORD_PARTY_3, kpiBatchDTO.getKpiTime(), true, false));

			jFreeChartHelper.createXYLineChart(resultMap, paramMap, "k2_2_4_2_zy_yc_xyLine_img");

			// 3、平均床日费 变化趋势图(天)
			paramMap.put("xyLine_chartDTO", new BaseChartDTO("平均床日费  变化趋势图(元)", "1"));
			paramMap.put(
					"xyLine_chartDataDTO",
					RtfElementDataHelper.getInstance().createZyRiYearSeriesList(resultMap, KpiValueConst.WORD_PARTY_3,
							kpiBatchDTO.getKpiTime(), true, true));

			jFreeChartHelper.createXYLineChart(resultMap, paramMap, "k2_2_4_2_cr_xyLine_img");

			// 4、平均床日费 变化趋势图(天)
			paramMap.put("xyLine_chartDTO", new BaseChartDTO("平均床日费  同比环比变化趋势图", "2"));
			paramMap.put(
					"xyLine_chartDataDTO",
					RtfElementDataHelper.getInstance().createZyRiYoyMomSeriesList(resultMap,
							KpiValueConst.WORD_PARTY_3, kpiBatchDTO.getKpiTime(), true, true));

			jFreeChartHelper.createXYLineChart(resultMap, paramMap, "k2_2_4_2_cr_yc_xyLine_img");
		}
	}

	/**
	 * 每床日费用
	 * 
	 * @param resultMap
	 *            resultMap
	 * @param paramMap
	 *            paramMap
	 * @param kpiQuotaLimitMap
	 *            kpiQuotaLimitMap
	 * @param kpiBatchDTO
	 *            kpiBatchDTO
	 */
	@Override
	public void getCostPerBedDayData(Map<String, Object> resultMap, Map<String, Object> paramMap,
			Map<String, Object> kpiQuotaLimitMap, KpiBatchDTO kpiBatchDTO) {
		// 这个方法和上面的方法合并了,
	}

	// ---------------郑超 end --------------------------------

	/**
	 * 杨理刚： 门诊费用 ：第一部分和第三部分 k0_3_1_2
	 * 
	 * @param resultMap
	 *            resultMap
	 * @param paramMap
	 *            paramMap
	 * @param kpiQuotaLimitMap
	 *            kpiQuotaLimitMap
	 * @param kpiBatchDTO
	 *            kpiBatchDTO
	 */
	@Override
	public void getOutpatFeeData(Map<String, Object> resultMap, Map<String, Object> paramMap,
			Map<String, Object> kpiQuotaLimitMap, KpiBatchDTO kpiBatchDTO) {
		Map<String, Object> outFeeToWord = wordReportService.getOutFeeToWord(paramMap, kpiQuotaLimitMap);

		GeneralMethods.getInstance().addAllValueToMap(outFeeToWord, resultMap);

		if (KpiValueConst.WORD_PARTY_1.equals(paramMap.get("type"))) {
			MakeJFreeChartImgParamHelper.makeMeterImgParamData(resultMap, paramMap, kpiQuotaLimitMap, new String[] {
					"同比", "k0_3_1_1_fee_yoy_end", "KPI0001", "0", "k0_3_1_1_fee_yoy_flag_end" });
			jFreeChartHelper.createMeterChart(resultMap, paramMap, "k0_3_1_1_fee_meter_yoy_img");

			MakeJFreeChartImgParamHelper.makeMeterImgParamData(resultMap, paramMap, kpiQuotaLimitMap, new String[] {
					"环比", "k0_3_1_1_fee_mom_end", "KPI0001", "1", "k0_3_1_1_fee_mom_flag_end" });
			jFreeChartHelper.createMeterChart(resultMap, paramMap, "k0_3_1_1_fee_meter_mom_img");

			// 2、医保费用占比
			paramMap.put("xyLine_chartDTO", new BaseChartDTO("门诊医疗费用  趋势图(亿元)", "1"));
			paramMap.put(
					"xyLine_chartDataDTO",
					RtfElementDataHelper.getInstance().createHospAOutpatFeeSeriesList(resultMap,
							KpiValueConst.WORD_PARTY_1, kpiBatchDTO.getKpiTime(), false));

			jFreeChartHelper.createXYLineChart(resultMap, paramMap, "k0_3_1_1_fee_xyLine_img");

			// 3、医保费用同比环比变化趋势图
			paramMap.put("xyLine_chartDTO", new BaseChartDTO("门诊医疗费用 同比环比变化趋势图", "2"));
			paramMap.put(
					"xyLine_chartDataDTO",
					RtfElementDataHelper.getInstance().createHospMedYcSeriesList(resultMap, KpiValueConst.WORD_PARTY_1,
							kpiBatchDTO.getKpiTime(), false));

			jFreeChartHelper.createXYLineChart(resultMap, paramMap, "k0_3_1_1_fee_xyLine_yc_img");

		} else if (KpiValueConst.WORD_PARTY_3.equals(paramMap.get("type"))) {
			MakeJFreeChartImgParamHelper.makeMeterImgParamData(resultMap, paramMap, kpiQuotaLimitMap, new String[] {
					"同比", "k2_3_1_1_fee_yoy_end", "KPI0001", "0", "k2_3_1_1_fee_yoy_flag_end" });
			jFreeChartHelper.createMeterChart(resultMap, paramMap, "k2_3_1_1_fee_meter_yoy_img");

			MakeJFreeChartImgParamHelper.makeMeterImgParamData(resultMap, paramMap, kpiQuotaLimitMap, new String[] {
					"环比", "k2_3_1_1_fee_mom_end", "KPI0001", "1", "k2_3_1_1_fee_mom_flag_end" });
			jFreeChartHelper.createMeterChart(resultMap, paramMap, "k2_3_1_1_fee_meter_mom_img");

			// 2、住院费用 趋势图
			paramMap.put("xyLine_chartDTO", new BaseChartDTO("门诊医疗费用  趋势图(万元)", "1"));
			paramMap.put(
					"xyLine_chartDataDTO",
					RtfElementDataHelper.getInstance().createHospAOutpatFeeSeriesList(resultMap,
							KpiValueConst.WORD_PARTY_3, kpiBatchDTO.getKpiTime(), false));

			jFreeChartHelper.createXYLineChart(resultMap, paramMap, "k2_3_1_1_Fee_Rate_xyLine_img");

			// 3、住院费用 同比环比变化趋势图
			paramMap.put("xyLine_chartDTO", new BaseChartDTO("门诊医疗费用  同比环比变化趋势图", "2"));
			paramMap.put(
					"xyLine_chartDataDTO",
					RtfElementDataHelper.getInstance().createHospMedYcSeriesList(resultMap, KpiValueConst.WORD_PARTY_3,
							kpiBatchDTO.getKpiTime(), false));

			jFreeChartHelper.createXYLineChart(resultMap, paramMap, "k2_3_1_1_Fee_yc_img");
		}
	}

	/**
	 * 杨理刚 门诊：门诊费用比值 k0_3_1_2
	 * 
	 * @param resultMap
	 *            resultMap
	 * @param paramMap
	 *            paramMap
	 * @param kpiQuotaLimitMap
	 *            kpiQuotaLimitMap
	 * @param kpiBatchDTO
	 *            kpiBatchDTO
	 */
	@Override
	public void getRateMedFeeInOutpatData(Map<String, Object> resultMap, Map<String, Object> paramMap,
			Map<String, Object> kpiQuotaLimitMap, KpiBatchDTO kpiBatchDTO) {
		Map<String, Object> outMedToWord = wordReportService.getOutMedToWord(paramMap, kpiQuotaLimitMap);

		GeneralMethods.getInstance().addAllValueToMap(outMedToWord, resultMap);

		if (KpiValueConst.WORD_PARTY_1.equals(paramMap.get("type"))) {
			// 住院費用的同比、生成同比环比
			MakeJFreeChartImgParamHelper.makeMeterImgParamData(resultMap, paramMap, kpiQuotaLimitMap, new String[] {
					"同比", "k0_3_1_2_f_yoy_end", "KPI0002", "0", "k0_3_1_2_f_yoy_flag_end" });
			jFreeChartHelper.createMeterChart(resultMap, paramMap, "k0_3_1_2_rate_meter_yoy_img");

			// 1、 生成同比环比仪表盘
			MakeJFreeChartImgParamHelper.makeMeterImgParamData(resultMap, paramMap, kpiQuotaLimitMap, new String[] {
					"环比", "k0_3_1_2_f_mom_end", "KPI0002", "1", "k0_3_1_2_f_mom_flag_end" });
			jFreeChartHelper.createMeterChart(resultMap, paramMap, "k0_3_1_2_rate_meter_mom_img");

			// 2、医保费用占比
			paramMap.put("xyLine_chartDTO", new BaseChartDTO("医保费用占比  趋势图", "2"));
			paramMap.put(
					"xyLine_chartDataDTO",
					RtfElementDataHelper.getInstance().createHospFeeRateSeriesList(resultMap,
							KpiValueConst.WORD_PARTY_1, kpiBatchDTO.getKpiTime(), false));

			jFreeChartHelper.createXYLineChart(resultMap, paramMap, "k0_3_1_2_Fee_Rate_xyLine_img");

			// 3、医保费用同比环比变化趋势图
			paramMap.put("xyLine_chartDTO", new BaseChartDTO("医保费用占比  同比环比变化趋势图", "2"));
			paramMap.put(
					"xyLine_chartDataDTO",
					RtfElementDataHelper.getInstance().createMedRateYcSeriesList(resultMap, KpiValueConst.WORD_PARTY_1,
							kpiBatchDTO.getKpiTime(), false));

			jFreeChartHelper.createXYLineChart(resultMap, paramMap, "k0_3_1_2_Fee_Rate_xyLine_yc_img");

		} else if (KpiValueConst.WORD_PARTY_3.equals(paramMap.get("type"))) {
			MakeJFreeChartImgParamHelper.makeMeterImgParamData(resultMap, paramMap, kpiQuotaLimitMap, new String[] {
					"同比", "k2_3_1_2_f_yoy_end", "KPI0002", "0", "k2_3_1_2_f_yoy_flag_end" });
			jFreeChartHelper.createMeterChart(resultMap, paramMap, "k2_3_1_2_rate_meter_yoy_img");

			MakeJFreeChartImgParamHelper.makeMeterImgParamData(resultMap, paramMap, kpiQuotaLimitMap, new String[] {
					"环比", "k2_3_1_2_f_mom_end", "KPI0002", "1", "k2_3_1_2_f_mom_flag_end" });
			jFreeChartHelper.createMeterChart(resultMap, paramMap, "k2_3_1_2_rate_meter_mom_img");

			paramMap.put("xyLine_chartDTO", new BaseChartDTO("医保费用占比  趋势图", "2"));
			paramMap.put(
					"xyLine_chartDataDTO",
					RtfElementDataHelper.getInstance().createHospFeeRateSeriesList(resultMap,
							KpiValueConst.WORD_PARTY_3, kpiBatchDTO.getKpiTime(), false));

			jFreeChartHelper.createXYLineChart(resultMap, paramMap, "k2_3_1_2_Fee_Rate_xyLine_img");

			paramMap.put("xyLine_chartDTO", new BaseChartDTO("医保费用占比  同比环比变化趋势图", "2"));
			paramMap.put(
					"xyLine_chartDataDTO",
					RtfElementDataHelper.getInstance().createMedRateYcSeriesList(resultMap, KpiValueConst.WORD_PARTY_3,
							kpiBatchDTO.getKpiTime(), false));

			jFreeChartHelper.createXYLineChart(resultMap, paramMap, "k2_3_1_2_Fee_Rate_xyLine_yc_img");

		}
	}

	/**
	 * 门诊：药品费用
	 * 
	 * @param resultMap
	 *            resultMap
	 * @param paramMap
	 *            paramMap
	 * @param kpiQuotaLimitMap
	 *            kpiQuotaLimitMap
	 * @param kpiBatchDTO
	 *            kpiBatchDTO
	 */
	@Override
	public void getDrugFeeInOutpatData(Map<String, Object> resultMap, Map<String, Object> paramMap,
			Map<String, Object> kpiQuotaLimitMap, KpiBatchDTO kpiBatchDTO) {

		if (KpiValueConst.WORD_PARTY_1.equals(paramMap.get("type"))) {
			Map<String, Object> drugMap = wordReportService.getOutMedicalFeeToWord(paramMap, kpiQuotaLimitMap);

			GeneralMethods.getInstance().addAllValueToMap(drugMap, resultMap);

			Map<String, Object> otherFeeMap = wordReportService.getOutOthersFeeToWord(paramMap, kpiQuotaLimitMap);
			GeneralMethods.getInstance().addAllValueToMap(otherFeeMap, resultMap);

			// 1、 门诊:药品同比环比仪表盘
			MakeJFreeChartImgParamHelper.makeMeterImgParamData(resultMap, paramMap, kpiQuotaLimitMap, new String[] {
					"同比", "k0_3_2_1_yoy_end", "KPI0053", "0", "k0_3_2_1_yoy_flag_end" });
			jFreeChartHelper.createMeterChart(resultMap, paramMap, "k0_3_2_1_fee_meter_yoy_img");

			MakeJFreeChartImgParamHelper.makeMeterImgParamData(resultMap, paramMap, kpiQuotaLimitMap, new String[] {
					"环比", "k0_3_2_1_mom_end", "KPI0053", "1", "k0_3_2_1_mom_flag_end" });
			jFreeChartHelper.createMeterChart(resultMap, paramMap, "k0_3_2_1_fee_meter_mom_img");

			// 3、第三部分药品占比的饼图
			paramMap.put("xyLine_chartDTO", new BaseChartDTO("门诊药占比 ", "2"));
			paramMap.put(
					"xyLine_chartDataDTO",
					RtfElementDataHelper.getInstance().getDrugFeeRatePieSeriesList(resultMap,
							KpiValueConst.WORD_PARTY_1, kpiBatchDTO.getKpiTime(), false));

			jFreeChartHelper.createPieChartPic(resultMap, paramMap, "k0_3_2_1_Fee_Rate_pie_img",
					KpiValueConst.MEDIATE_PIC);

		} else if (KpiValueConst.WORD_PARTY_3.equals(paramMap.get("type"))) {
			Map<String, Object> drugMap = wordReportService.getOutMedicalFeeToWordByOrg(paramMap, kpiQuotaLimitMap);
			GeneralMethods.getInstance().addAllValueToMap(drugMap, resultMap);

			Map<String, Object> otherFeeMap = wordReportService.getOutOthersFeeToWordByOrg(paramMap, kpiQuotaLimitMap);
			GeneralMethods.getInstance().addAllValueToMap(otherFeeMap, resultMap);

			// 1、 门诊:药品同比环比仪表盘
			MakeJFreeChartImgParamHelper.makeMeterImgParamData(resultMap, paramMap, kpiQuotaLimitMap, new String[] {
					"同比", "k2_3_2_1_yoy_end", "KPI0053", "0", "k2_3_2_1_yoy_flag_end" });
			jFreeChartHelper.createMeterChart(resultMap, paramMap, "k2_3_2_1_fee_meter_yoy_img");

			MakeJFreeChartImgParamHelper.makeMeterImgParamData(resultMap, paramMap, kpiQuotaLimitMap, new String[] {
					"环比", "k2_3_2_1_mom_end", "KPI0053", "1", "k2_3_2_1_mom_flag_end" });
			jFreeChartHelper.createMeterChart(resultMap, paramMap, "k2_3_2_1_fee_meter_mom_img");

			// 3、第三部分药品占比的饼图
			paramMap.put("xyLine_chartDTO", new BaseChartDTO("门诊药占比", "2"));
			paramMap.put(
					"xyLine_chartDataDTO",
					RtfElementDataHelper.getInstance().getDrugFeeRatePieSeriesList(resultMap,
							KpiValueConst.WORD_PARTY_3, kpiBatchDTO.getKpiTime(), false));
			jFreeChartHelper.createPieChartPic(resultMap, paramMap, "k2_3_2_1_Fee_Rate_pie_img",
					KpiValueConst.MEDIATE_PIC);

		}
	}

	/**
	 * 门诊：其他费用
	 * 
	 * @param resultMap
	 *            resultMap
	 * @param paramMap
	 *            paramMap
	 * @param kpiQuotaLimitMap
	 *            kpiQuotaLimitMap
	 * @param kpiBatchDTO
	 *            kpiBatchDTO
	 */
	@SuppressWarnings("unchecked")
	@Override
	public void getOtherFeeInOutpatData(Map<String, Object> resultMap, Map<String, Object> paramMap,
			Map<String, Object> kpiQuotaLimitMap, KpiBatchDTO kpiBatchDTO) {
		if (KpiValueConst.WORD_PARTY_1.equals(paramMap.get("type"))) {
			// 2、 门诊:其他费用同比环比仪表盘
			MakeJFreeChartImgParamHelper.makeMeterImgParamData(resultMap, paramMap, kpiQuotaLimitMap, new String[] {
					"同比", "k0_3_2_2_yoy_end", "KPI0070", "0", "k0_3_2_2_yoy_flag_end" });
			jFreeChartHelper.createMeterChart(resultMap, paramMap, "k0_3_2_2_fee_meter_yoy_img");

			MakeJFreeChartImgParamHelper.makeMeterImgParamData(resultMap, paramMap, kpiQuotaLimitMap, new String[] {
					"环比", "k0_3_2_2_mom_end", "KPI0070", "1", "k0_3_2_2_mom_flag_end" });
			jFreeChartHelper.createMeterChart(resultMap, paramMap, "k0_3_2_2_fee_meter_mom_img");

			Table table = CreateRtfTableDataHelper.getInstance().crateDrugOtherFeeTable(
					(List<String[]>) resultMap.get("k0_3_2_2_fee_tableList_end"), " 本 期 金 额    (万 元 )");
			resultMap.put("k0_3_2_2_fee_table",
					CreateRtfTableDataHelper.getInstance().getTableStr(table, rtfReportTemplatePath));

			// 4、第三部分其他费用占比的饼图
			paramMap.put("xyLine_chartDTO", new BaseChartDTO("门诊费用分布图(除药费外)", "2"));
			paramMap.put(
					"xyLine_chartDataDTO",
					RtfElementDataHelper.getInstance().getOtherFeeRatePieSeriesList(resultMap,
							KpiValueConst.WORD_PARTY_1, kpiBatchDTO.getKpiTime(), false));

			jFreeChartHelper.createPieChartPic(resultMap, paramMap, "k0_3_2_2_fee_pie_img");

			// 1、检查费
			paramMap.put("xyLine_chartDTO", new BaseChartDTO("门诊检查费 变化趋势图(万元)", "1"));
			paramMap.put(
					"xyLine_chartDataDTO",
					RtfElementDataHelper.getInstance().createDrugOtherFeeSeriesList(resultMap,
							KpiValueConst.WORD_PARTY_1, kpiBatchDTO.getKpiTime(), false, "2"));
			jFreeChartHelper.createXYLineChart(resultMap, paramMap, "k0_3_2_2_fee_xyLine_zy_img");

			paramMap.put("xyLine_chartDTO", new BaseChartDTO("门诊检查费 同比环比变化趋势图", "2"));
			paramMap.put(
					"xyLine_chartDataDTO",
					RtfElementDataHelper.getInstance().createDrugOtherFeeYoyMomSeriesList(resultMap,
							KpiValueConst.WORD_PARTY_1, kpiBatchDTO.getKpiTime(), false, "2"));

			jFreeChartHelper.createXYLineChart(resultMap, paramMap, "k0_3_2_2_fee_xyLine_zy_yc_img");

			// 2、手术费
			paramMap.put("xyLine_chartDTO", new BaseChartDTO("门诊手术费 变化趋势图(万元)", "1"));
			paramMap.put(
					"xyLine_chartDataDTO",
					RtfElementDataHelper.getInstance().createDrugOtherFeeSeriesList(resultMap,
							KpiValueConst.WORD_PARTY_1, kpiBatchDTO.getKpiTime(), false, "25"));
			jFreeChartHelper.createXYLineChart(resultMap, paramMap, "k0_3_2_25_fee_xyLine_zy_img");

			paramMap.put("xyLine_chartDTO", new BaseChartDTO("门诊手术费 同比环比变化趋势图", "2"));
			paramMap.put(
					"xyLine_chartDataDTO",
					RtfElementDataHelper.getInstance().createDrugOtherFeeYoyMomSeriesList(resultMap,
							KpiValueConst.WORD_PARTY_1, kpiBatchDTO.getKpiTime(), false, "25"));

			jFreeChartHelper.createXYLineChart(resultMap, paramMap, "k0_3_2_25_fee_xyLine_zy_yc_img");

			// 3、治疗费
			paramMap.put("xyLine_chartDTO", new BaseChartDTO("门诊治疗费 变化趋势图(万元)", "1"));
			paramMap.put(
					"xyLine_chartDataDTO",
					RtfElementDataHelper.getInstance().createDrugOtherFeeSeriesList(resultMap,
							KpiValueConst.WORD_PARTY_1, kpiBatchDTO.getKpiTime(), false, "30"));
			jFreeChartHelper.createXYLineChart(resultMap, paramMap, "k0_3_2_30_fee_xyLine_zy_img");

			paramMap.put("xyLine_chartDTO", new BaseChartDTO("门诊治疗费 同比环比变化趋势图", "2"));
			paramMap.put(
					"xyLine_chartDataDTO",
					RtfElementDataHelper.getInstance().createDrugOtherFeeYoyMomSeriesList(resultMap,
							KpiValueConst.WORD_PARTY_1, kpiBatchDTO.getKpiTime(), false, "30"));

			jFreeChartHelper.createXYLineChart(resultMap, paramMap, "k0_3_2_30_fee_xyLine_zy_yc_img");

			// 4、化验费
			paramMap.put("xyLine_chartDTO", new BaseChartDTO("门诊化验费 变化趋势图(万元)", "1"));
			paramMap.put(
					"xyLine_chartDataDTO",
					RtfElementDataHelper.getInstance().createDrugOtherFeeSeriesList(resultMap,
							KpiValueConst.WORD_PARTY_1, kpiBatchDTO.getKpiTime(), false, "32"));
			jFreeChartHelper.createXYLineChart(resultMap, paramMap, "k0_3_2_32_fee_xyLine_zy_img");

			paramMap.put("xyLine_chartDTO", new BaseChartDTO("门诊化验费 同比环比变化趋势图", "2"));
			paramMap.put(
					"xyLine_chartDataDTO",
					RtfElementDataHelper.getInstance().createDrugOtherFeeYoyMomSeriesList(resultMap,
							KpiValueConst.WORD_PARTY_1, kpiBatchDTO.getKpiTime(), false, "32"));

			jFreeChartHelper.createXYLineChart(resultMap, paramMap, "k0_3_2_32_fee_xyLine_zy_yc_img");

			// 5、其他费 KPI0035
			paramMap.put("xyLine_chartDTO", new BaseChartDTO("门诊其他费 变化趋势图(万元)", "1"));
			paramMap.put(
					"xyLine_chartDataDTO",
					RtfElementDataHelper.getInstance().createDrugOtherFeeSeriesList(resultMap,
							KpiValueConst.WORD_PARTY_1, kpiBatchDTO.getKpiTime(), false, "35"));
			jFreeChartHelper.createXYLineChart(resultMap, paramMap, "k0_3_2_35_fee_xyLine_zy_img");

			paramMap.put("xyLine_chartDTO", new BaseChartDTO("门诊其他费 同比环比变化趋势图", "2"));
			paramMap.put(
					"xyLine_chartDataDTO",
					RtfElementDataHelper.getInstance().createDrugOtherFeeYoyMomSeriesList(resultMap,
							KpiValueConst.WORD_PARTY_1, kpiBatchDTO.getKpiTime(), false, "35"));

			jFreeChartHelper.createXYLineChart(resultMap, paramMap, "k0_3_2_35_fee_xyLine_zy_yc_img");

			// 6、其余费 KPI0069
			paramMap.put("xyLine_chartDTO", new BaseChartDTO("门诊其余费 变化趋势图(万元)", "1"));
			paramMap.put(
					"xyLine_chartDataDTO",
					RtfElementDataHelper.getInstance().createDrugOtherFeeSeriesList(resultMap,
							KpiValueConst.WORD_PARTY_1, kpiBatchDTO.getKpiTime(), false, "69"));
			jFreeChartHelper.createXYLineChart(resultMap, paramMap, "k0_3_2_69_fee_xyLine_zy_img");

			paramMap.put("xyLine_chartDTO", new BaseChartDTO("门诊其余费 同比环比变化趋势图", "2"));
			paramMap.put(
					"xyLine_chartDataDTO",
					RtfElementDataHelper.getInstance().createDrugOtherFeeYoyMomSeriesList(resultMap,
							KpiValueConst.WORD_PARTY_1, kpiBatchDTO.getKpiTime(), false, "69"));

			jFreeChartHelper.createXYLineChart(resultMap, paramMap, "k0_3_2_69_fee_xyLine_zy_yc_img");

		} else if (KpiValueConst.WORD_PARTY_3.equals(paramMap.get("type"))) {
			// 2、 门诊:其他费用同比环比仪表盘
			MakeJFreeChartImgParamHelper.makeMeterImgParamData(resultMap, paramMap, kpiQuotaLimitMap, new String[] {
					"同比", "k2_3_2_2_yoy_end", "KPI0070", "0", "k2_3_2_2_yoy_flag_end" });
			jFreeChartHelper.createMeterChart(resultMap, paramMap, "k2_3_2_2_fee_meter_yoy_img");

			MakeJFreeChartImgParamHelper.makeMeterImgParamData(resultMap, paramMap, kpiQuotaLimitMap, new String[] {
					"环比", "k2_3_2_2_mom_end", "KPI0070", "1", "k2_3_2_2_mom_flag_end" });
			jFreeChartHelper.createMeterChart(resultMap, paramMap, "k2_3_2_2_fee_meter_mom_img");

			// 其他费用table k2_3_2_2_fee_table
			Table table = CreateRtfTableDataHelper.getInstance().crateDrugOtherFeeTable(
					(List<String[]>) resultMap.get("k2_3_2_2_fee_tableList_end"), " 本 期 金 额    (万 元 )");

			resultMap.put("k2_3_2_2_fee_table",
					CreateRtfTableDataHelper.getInstance().getTableStr(table, rtfReportTemplatePath));

			// 4、第三部分其他费用占比的饼图
			paramMap.put("xyLine_chartDTO", new BaseChartDTO("门诊费用分布图(除药费外)", "2"));
			paramMap.put(
					"xyLine_chartDataDTO",
					RtfElementDataHelper.getInstance().getOtherFeeRatePieSeriesList(resultMap,
							KpiValueConst.WORD_PARTY_3, kpiBatchDTO.getKpiTime(), false));

			jFreeChartHelper.createPieChartPic(resultMap, paramMap, "k2_3_2_2_fee_pie_img");

			// 1、检查费
			paramMap.put("xyLine_chartDTO", new BaseChartDTO("门诊检查费 变化趋势图(万元)", "1"));
			paramMap.put(
					"xyLine_chartDataDTO",
					RtfElementDataHelper.getInstance().createDrugOtherFeeSeriesList(resultMap,
							KpiValueConst.WORD_PARTY_3, kpiBatchDTO.getKpiTime(), false, "2"));
			jFreeChartHelper.createXYLineChart(resultMap, paramMap, "k2_3_2_2_fee_xyLine_zy_img");

			paramMap.put("xyLine_chartDTO", new BaseChartDTO("门诊检查费 同比环比变化趋势图", "2"));
			paramMap.put(
					"xyLine_chartDataDTO",
					RtfElementDataHelper.getInstance().createDrugOtherFeeYoyMomSeriesList(resultMap,
							KpiValueConst.WORD_PARTY_3, kpiBatchDTO.getKpiTime(), false, "2"));

			jFreeChartHelper.createXYLineChart(resultMap, paramMap, "k2_3_2_2_fee_xyLine_zy_yc_img");

			// 2、手术费
			paramMap.put("xyLine_chartDTO", new BaseChartDTO("门诊手术费 变化趋势图(万元)", "1"));
			paramMap.put(
					"xyLine_chartDataDTO",
					RtfElementDataHelper.getInstance().createDrugOtherFeeSeriesList(resultMap,
							KpiValueConst.WORD_PARTY_3, kpiBatchDTO.getKpiTime(), false, "25"));
			jFreeChartHelper.createXYLineChart(resultMap, paramMap, "k2_3_2_25_fee_xyLine_zy_img");

			paramMap.put("xyLine_chartDTO", new BaseChartDTO("门诊手术费 同比环比变化趋势图", "2"));
			paramMap.put(
					"xyLine_chartDataDTO",
					RtfElementDataHelper.getInstance().createDrugOtherFeeYoyMomSeriesList(resultMap,
							KpiValueConst.WORD_PARTY_3, kpiBatchDTO.getKpiTime(), false, "25"));

			jFreeChartHelper.createXYLineChart(resultMap, paramMap, "k2_3_2_25_fee_xyLine_zy_yc_img");

			// 3、治疗费
			paramMap.put("xyLine_chartDTO", new BaseChartDTO("门诊治疗费 变化趋势图(万元)", "1"));
			paramMap.put(
					"xyLine_chartDataDTO",
					RtfElementDataHelper.getInstance().createDrugOtherFeeSeriesList(resultMap,
							KpiValueConst.WORD_PARTY_3, kpiBatchDTO.getKpiTime(), false, "30"));
			jFreeChartHelper.createXYLineChart(resultMap, paramMap, "k2_3_2_30_fee_xyLine_zy_img");

			paramMap.put("xyLine_chartDTO", new BaseChartDTO("门诊治疗费 同比环比变化趋势图", "2"));
			paramMap.put(
					"xyLine_chartDataDTO",
					RtfElementDataHelper.getInstance().createDrugOtherFeeYoyMomSeriesList(resultMap,
							KpiValueConst.WORD_PARTY_3, kpiBatchDTO.getKpiTime(), false, "30"));

			jFreeChartHelper.createXYLineChart(resultMap, paramMap, "k2_3_2_30_fee_xyLine_zy_yc_img");

			// 4、化验费
			paramMap.put("xyLine_chartDTO", new BaseChartDTO("门诊化验费 变化趋势图(万元)", "1"));
			paramMap.put(
					"xyLine_chartDataDTO",
					RtfElementDataHelper.getInstance().createDrugOtherFeeSeriesList(resultMap,
							KpiValueConst.WORD_PARTY_3, kpiBatchDTO.getKpiTime(), false, "32"));
			jFreeChartHelper.createXYLineChart(resultMap, paramMap, "k2_3_2_32_fee_xyLine_zy_img");

			paramMap.put("xyLine_chartDTO", new BaseChartDTO("门诊化验费 同比环比变化趋势图", "2"));
			paramMap.put(
					"xyLine_chartDataDTO",
					RtfElementDataHelper.getInstance().createDrugOtherFeeYoyMomSeriesList(resultMap,
							KpiValueConst.WORD_PARTY_3, kpiBatchDTO.getKpiTime(), false, "32"));

			jFreeChartHelper.createXYLineChart(resultMap, paramMap, "k2_3_2_32_fee_xyLine_zy_yc_img");

			// 5、其他费 KPI0035
			paramMap.put("xyLine_chartDTO", new BaseChartDTO("门诊其他费 变化趋势图(万元)", "1"));
			paramMap.put(
					"xyLine_chartDataDTO",
					RtfElementDataHelper.getInstance().createDrugOtherFeeSeriesList(resultMap,
							KpiValueConst.WORD_PARTY_3, kpiBatchDTO.getKpiTime(), false, "35"));
			jFreeChartHelper.createXYLineChart(resultMap, paramMap, "k2_3_2_35_fee_xyLine_zy_img");

			paramMap.put("xyLine_chartDTO", new BaseChartDTO("门诊其他费 同比环比变化趋势图", "2"));
			paramMap.put(
					"xyLine_chartDataDTO",
					RtfElementDataHelper.getInstance().createDrugOtherFeeYoyMomSeriesList(resultMap,
							KpiValueConst.WORD_PARTY_3, kpiBatchDTO.getKpiTime(), false, "35"));

			jFreeChartHelper.createXYLineChart(resultMap, paramMap, "k2_3_2_35_fee_xyLine_zy_yc_img");

			// 6、其余费 KPI0069
			paramMap.put("xyLine_chartDTO", new BaseChartDTO("门诊其余费 变化趋势图(万元)", "1"));
			paramMap.put(
					"xyLine_chartDataDTO",
					RtfElementDataHelper.getInstance().createDrugOtherFeeSeriesList(resultMap,
							KpiValueConst.WORD_PARTY_3, kpiBatchDTO.getKpiTime(), false, "69"));
			jFreeChartHelper.createXYLineChart(resultMap, paramMap, "k2_3_2_69_fee_xyLine_zy_img");

			paramMap.put("xyLine_chartDTO", new BaseChartDTO("门诊其余费 同比环比变化趋势图", "2"));
			paramMap.put(
					"xyLine_chartDataDTO",
					RtfElementDataHelper.getInstance().createDrugOtherFeeYoyMomSeriesList(resultMap,
							KpiValueConst.WORD_PARTY_3, kpiBatchDTO.getKpiTime(), false, "69"));

			jFreeChartHelper.createXYLineChart(resultMap, paramMap, "k2_3_2_69_fee_xyLine_zy_yc_img");
		}
	}

	/**
	 * TODO 张纪成 门诊：门诊人次
	 * 
	 * @param resultMap
	 *            resultMap
	 * @param paramMap
	 *            paramMap
	 * @param kpiQuotaLimitMap
	 *            kpiQuotaLimitMap
	 * @param kpiBatchDTO
	 *            kpiBatchDTO
	 */
	@Override
	public void getDischargePeoplesInOutpatData(Map<String, Object> resultMap, Map<String, Object> paramMap,
			Map<String, Object> kpiQuotaLimitMap, KpiBatchDTO kpiBatchDTO) {
		Map<String, Object> totalPersonHospNumInfo = wordReportService.getTotalPersonOutNumInfo(paramMap,
				kpiQuotaLimitMap);

		GeneralMethods.getInstance().addAllValueToMap(totalPersonHospNumInfo, resultMap);

		if (KpiValueConst.WORD_PARTY_1.equals(paramMap.get("type"))) {
			// 住院費用的同比、生成同比环比
			MakeJFreeChartImgParamHelper.makeMeterImgParamData(resultMap, paramMap, kpiQuotaLimitMap, new String[] {
					"同比", "k0_3_3_1_yoy_end", "KPI0010", "0", "k0_3_3_1_yoy_flag_end" });
			jFreeChartHelper.createMeterChart(resultMap, paramMap, "k0_3_3_1_times_meter_yoy_img");

			MakeJFreeChartImgParamHelper.makeMeterImgParamData(resultMap, paramMap, kpiQuotaLimitMap, new String[] {
					"环比", "k0_3_3_1_mom_end", "KPI0010", "1", "k0_3_3_1_mom_flag_end" });
			jFreeChartHelper.createMeterChart(resultMap, paramMap, "k0_3_3_1_times_meter_mom_img");

		} else if (KpiValueConst.WORD_PARTY_3.equals(paramMap.get("type"))) {
			// 同比环比趋势图
			MakeJFreeChartImgParamHelper.makeMeterImgParamData(resultMap, paramMap, kpiQuotaLimitMap, new String[] {
					"同比", "k2_3_3_1_yoy_end", "KPI0010", "0", "k2_3_3_1_yoy_flag_end" });
			jFreeChartHelper.createMeterChart(resultMap, paramMap, "k2_3_3_1_times_meter_yoy_img");

			// 1、 生成同比环比仪表盘
			MakeJFreeChartImgParamHelper.makeMeterImgParamData(resultMap, paramMap, kpiQuotaLimitMap, new String[] {
					"环比", "k2_3_3_1_mom_end", "KPI0010", "1", "k2_3_3_1_mom_flag_end" });
			jFreeChartHelper.createMeterChart(resultMap, paramMap, "k2_3_3_1_times_meter_mom_img");

		}
	}

	/**
	 * TODO 张纪成 k2_3_3_2 k0_3_3_2 门诊：次均费用
	 * 
	 * @param resultMap
	 *            resultMap
	 * @param paramMap
	 *            paramMap
	 * @param kpiQuotaLimitMap
	 *            kpiQuotaLimitMap
	 * @param kpiBatchDTO
	 *            kpiBatchDTO
	 */
	@Override
	public void getAvgOneTimesFeeInOutpatData(Map<String, Object> resultMap, Map<String, Object> paramMap,
			Map<String, Object> kpiQuotaLimitMap, KpiBatchDTO kpiBatchDTO) {
		Map<String, Object> totalPersonHospNumInfo = wordReportService.getTotalPersonOutNumAverageFee(paramMap,
				kpiQuotaLimitMap);

		GeneralMethods.getInstance().addAllValueToMap(totalPersonHospNumInfo, resultMap);

		if (KpiValueConst.WORD_PARTY_1.equals(paramMap.get("type"))) {
			// 住院費用的同比、生成同比环比
			MakeJFreeChartImgParamHelper.makeMeterImgParamData(resultMap, paramMap, kpiQuotaLimitMap, new String[] {
					"同比", "k0_3_3_2_yoy_end", "KPI0004", "0", "k0_3_3_2_yoy_flag_end" });
			jFreeChartHelper.createMeterChart(resultMap, paramMap, "k0_3_3_2_fee_meter_yoy_img");

			MakeJFreeChartImgParamHelper.makeMeterImgParamData(resultMap, paramMap, kpiQuotaLimitMap, new String[] {
					"环比", "k0_3_3_2_mom_end", "KPI0004", "1", "k0_3_3_2_mom_flag_end" });
			jFreeChartHelper.createMeterChart(resultMap, paramMap, "k0_3_3_2_fee_meter_mom_img");

			// k0_2_3_2_fh_xyLine_img
			paramMap.put("xyLine_chartDTO", new BaseChartDTO("门诊人次和次均费用", "1", GeneralMethods.getInstance()
					.reversalStr("次均费用)元("), "门诊人次(人次)"));
			paramMap.put(
					"xyLine_chartDataDTO",
					RtfElementDataHelper.getInstance().createCyCjSeriesList(resultMap, KpiValueConst.WORD_PARTY_1,
							kpiBatchDTO.getKpiTime(), false));
			jFreeChartHelper.createCombinedChart(resultMap, paramMap, "k0_3_3_2_fh_xyLine_img");

			paramMap.put("xyLine_chartDTO", new BaseChartDTO("门诊人次 变化趋势图(人次)", "1"));
			paramMap.put(
					"xyLine_chartDataDTO",
					RtfElementDataHelper.getInstance().createCyRcSeriesList(resultMap, KpiValueConst.WORD_PARTY_1,
							kpiBatchDTO.getKpiTime(), false));

			jFreeChartHelper.createXYLineChart(resultMap, paramMap, "k0_3_3_2_cy_xyLine_img");

			// 住院检查费 同比环比变化趋势图
			paramMap.put("xyLine_chartDTO", new BaseChartDTO("门诊人次  同比环比变化趋势图", "2"));
			paramMap.put(
					"xyLine_chartDataDTO",
					RtfElementDataHelper.getInstance().createCyYcSeriesList(resultMap, KpiValueConst.WORD_PARTY_1,
							kpiBatchDTO.getKpiTime(), false));

			jFreeChartHelper.createXYLineChart(resultMap, paramMap, "k0_3_3_2_cy_ycLine_img");

			// 次均费用
			paramMap.put("xyLine_chartDTO", new BaseChartDTO("次均费用  变化趋势图(元)", "1"));
			paramMap.put(
					"xyLine_chartDataDTO",
					RtfElementDataHelper.getInstance().createCjFeeSeriesList(resultMap, KpiValueConst.WORD_PARTY_1,
							kpiBatchDTO.getKpiTime(), false));

			jFreeChartHelper.createXYLineChart(resultMap, paramMap, "k0_3_3_2_cj_xyLine_img");

			// 住院检查费 同比环比变化趋势图
			paramMap.put("xyLine_chartDTO", new BaseChartDTO("次均费用  同比环比变化趋势图", "2"));
			paramMap.put(
					"xyLine_chartDataDTO",
					RtfElementDataHelper.getInstance().createCjYcSeriesList(resultMap, KpiValueConst.WORD_PARTY_1,
							kpiBatchDTO.getKpiTime(), false));

			jFreeChartHelper.createXYLineChart(resultMap, paramMap, "k0_3_3_2_cj_ycLine_img");

		} else if (KpiValueConst.WORD_PARTY_3.equals(paramMap.get("type"))) {
			// 住院費用的同比、生成同比环比
			MakeJFreeChartImgParamHelper.makeMeterImgParamData(resultMap, paramMap, kpiQuotaLimitMap, new String[] {
					"同比", "k2_3_3_2_yoy_end", "KPI0004", "0", "k2_3_3_2_yoy_flag_end" });
			jFreeChartHelper.createMeterChart(resultMap, paramMap, "k2_3_3_2_fee_meter_yoy_img");

			MakeJFreeChartImgParamHelper.makeMeterImgParamData(resultMap, paramMap, kpiQuotaLimitMap, new String[] {
					"环比", "k2_3_3_2_mom_end", "KPI0004", "1", "k2_3_3_2_mom_flag_end" });
			jFreeChartHelper.createMeterChart(resultMap, paramMap, "k2_3_3_2_fee_meter_mom_img");

			// k0_2_3_2_fh_xyLine_img
			paramMap.put("xyLine_chartDTO", new BaseChartDTO("门诊人次和次均费用", "1", GeneralMethods.getInstance()
					.reversalStr("次均费用)元("), "门诊人次(人次)"));
			paramMap.put(
					"xyLine_chartDataDTO",
					RtfElementDataHelper.getInstance().createCyCjSeriesList(resultMap, KpiValueConst.WORD_PARTY_3,
							kpiBatchDTO.getKpiTime(), false));
			jFreeChartHelper.createCombinedChart(resultMap, paramMap, "k2_3_3_2_fh_xyLine_img");

			paramMap.put("xyLine_chartDTO", new BaseChartDTO("门诊人次 变化趋势图(人次)", "1"));
			paramMap.put(
					"xyLine_chartDataDTO",
					RtfElementDataHelper.getInstance().createCyRcSeriesList(resultMap, KpiValueConst.WORD_PARTY_3,
							kpiBatchDTO.getKpiTime(), false));

			jFreeChartHelper.createXYLineChart(resultMap, paramMap, "k2_3_3_2_cy_xyLine_img");

			// 住院检查费 同比环比变化趋势图
			paramMap.put("xyLine_chartDTO", new BaseChartDTO("门诊人次  同比环比变化趋势图", "2"));
			paramMap.put(
					"xyLine_chartDataDTO",
					RtfElementDataHelper.getInstance().createCyYcSeriesList(resultMap, KpiValueConst.WORD_PARTY_3,
							kpiBatchDTO.getKpiTime(), false));

			jFreeChartHelper.createXYLineChart(resultMap, paramMap, "k2_3_3_2_cy_ycLine_img");

			// 次均费用
			paramMap.put("xyLine_chartDTO", new BaseChartDTO("次均费用  变化趋势图(元)", "1"));
			paramMap.put(
					"xyLine_chartDataDTO",
					RtfElementDataHelper.getInstance().createCjFeeSeriesList(resultMap, KpiValueConst.WORD_PARTY_3,
							kpiBatchDTO.getKpiTime(), false));

			jFreeChartHelper.createXYLineChart(resultMap, paramMap, "k2_3_3_2_cj_xyLine_img");

			// 住院检查费 同比环比变化趋势图
			paramMap.put("xyLine_chartDTO", new BaseChartDTO("次均费用  同比环比变化趋势图", "2"));
			paramMap.put(
					"xyLine_chartDataDTO",
					RtfElementDataHelper.getInstance().createCjYcSeriesList(resultMap, KpiValueConst.WORD_PARTY_3,
							kpiBatchDTO.getKpiTime(), false));

			jFreeChartHelper.createXYLineChart(resultMap, paramMap, "k2_3_3_2_cj_ycLine_img");
		}
	}

	// -------------------门诊：郑超 begin--------------
	/**
	 * 门诊：门诊人数 -人均费用
	 * 
	 * @param resultMap
	 *            resultMap
	 * @param paramMap
	 *            paramMap
	 * @param kpiQuotaLimitMap
	 *            kpiQuotaLimitMap
	 * @param kpiBatchDTO
	 *            kpiBatchDTO
	 */
	@Override
	public void getPeopleTimesOutpatData(Map<String, Object> resultMap, Map<String, Object> paramMap,
			Map<String, Object> kpiQuotaLimitMap, KpiBatchDTO kpiBatchDTO) {
		if (KpiValueConst.WORD_PARTY_1.equals(paramMap.get("type"))) {

			paramMap.put("visitType", KpiValueConst.VISIT_TYP_OUTPAT);
			Map<String, Object> queryOutData = wordReportService.queryOutData(paramMap, kpiQuotaLimitMap);
			GeneralMethods.getInstance().addAllValueToMap(queryOutData, resultMap);

			Map<String, Object> queryOutYearData = wordReportService.queryOutYearData(paramMap);
			GeneralMethods.getInstance().addAllValueToMap(queryOutYearData, resultMap);

			// 门诊人数 -门诊人数的同比、生成同比环比
			MakeJFreeChartImgParamHelper.makeMeterImgParamData(resultMap, paramMap, kpiQuotaLimitMap, new String[] {
					"同比", "k0_3_4_1_yoy_end", "KPI0039", "0", "k0_3_4_1_yoy_flag_end" });
			jFreeChartHelper.createMeterChart(resultMap, paramMap, "k0_3_4_1_days_meter_yoy_img");

			MakeJFreeChartImgParamHelper.makeMeterImgParamData(resultMap, paramMap, kpiQuotaLimitMap, new String[] {
					"环比", "k0_3_4_1_mom_end", "KPI0039", "1", "k0_3_4_1_mom_flag_end" });
			jFreeChartHelper.createMeterChart(resultMap, paramMap, "k0_3_4_1_days_meter_mom_img");

			// 门诊人数 -人均费用的同比、生成同比环比
			MakeJFreeChartImgParamHelper.makeMeterImgParamData(resultMap, paramMap, kpiQuotaLimitMap, new String[] {
					"同比", "k0_3_4_2_yoy_end", "KPI0052", "0", "k0_3_4_2_yoy_flag_end" });
			jFreeChartHelper.createMeterChart(resultMap, paramMap, "k0_3_4_2_fee_meter_yoy_img");

			MakeJFreeChartImgParamHelper.makeMeterImgParamData(resultMap, paramMap, kpiQuotaLimitMap, new String[] {
					"环比", "k0_3_4_2_mom_end", "KPI0052", "1", "k0_3_4_2_mom_flag_end" });
			jFreeChartHelper.createMeterChart(resultMap, paramMap, "k0_3_4_2_fee_meter_mom_img");

			// 2、门诊人数 -人均费用 ----------------- 混合图表
			paramMap.put("xyLine_chartDTO", new BaseChartDTO("门诊人数和人均费用", "1", GeneralMethods.getInstance()
					.reversalStr("人均费用)元("), "门诊人数(人)"));
			paramMap.put(
					"xyLine_chartDataDTO",
					RtfElementDataHelper.getInstance().createAvgBedFeeSeriesList(resultMap, KpiValueConst.WORD_PARTY_1,
							kpiBatchDTO.getKpiTime(), false));

			jFreeChartHelper.createCombinedChart(resultMap, paramMap, "k0_3_4_2_fee_xyLine_img");

			// 1、平均住院日 变化趋势图(天)
			paramMap.put("xyLine_chartDTO", new BaseChartDTO("门诊人数  变化趋势图(人)", "1"));
			paramMap.put(
					"xyLine_chartDataDTO",
					RtfElementDataHelper.getInstance().createZyRiYearSeriesList(resultMap, KpiValueConst.WORD_PARTY_1,
							kpiBatchDTO.getKpiTime(), false, false));

			jFreeChartHelper.createXYLineChart(resultMap, paramMap, "k0_3_4_2_zy_xyLine_img");

			// 2、平均住院日 同比环比变化趋势图
			paramMap.put("xyLine_chartDTO", new BaseChartDTO("门诊人数  同比环比变化趋势图", "2"));
			paramMap.put(
					"xyLine_chartDataDTO",
					RtfElementDataHelper.getInstance().createZyRiYoyMomSeriesList(resultMap,
							KpiValueConst.WORD_PARTY_1, kpiBatchDTO.getKpiTime(), false, false));

			jFreeChartHelper.createXYLineChart(resultMap, paramMap, "k0_3_4_2_zy_yc_xyLine_img");

			// 3、平均床日费 变化趋势图(天)
			paramMap.put("xyLine_chartDTO", new BaseChartDTO("人均费用  变化趋势图(元)", "1"));
			paramMap.put(
					"xyLine_chartDataDTO",
					RtfElementDataHelper.getInstance().createZyRiYearSeriesList(resultMap, KpiValueConst.WORD_PARTY_1,
							kpiBatchDTO.getKpiTime(), false, false));

			jFreeChartHelper.createXYLineChart(resultMap, paramMap, "k0_3_4_2_cr_xyLine_img");

			// 4、平均床日费 变化趋势图(天)
			paramMap.put("xyLine_chartDTO", new BaseChartDTO("人均费用  同比环比变化趋势图", "2"));
			paramMap.put(
					"xyLine_chartDataDTO",
					RtfElementDataHelper.getInstance().createZyRiYoyMomSeriesList(resultMap,
							KpiValueConst.WORD_PARTY_1, kpiBatchDTO.getKpiTime(), false, false));

			jFreeChartHelper.createXYLineChart(resultMap, paramMap, "k0_3_4_2_cr_yc_xyLine_img");

		} else if (KpiValueConst.WORD_PARTY_3.equals(paramMap.get("type"))) {

			paramMap.put("visitType", KpiValueConst.VISIT_TYP_OUTPAT);
			Map<String, Object> queryOneOutData = wordReportService.queryOneOutData(paramMap, kpiQuotaLimitMap);
			GeneralMethods.getInstance().addAllValueToMap(queryOneOutData, resultMap);

			Map<String, Object> queryOneOutYearData = wordReportService.queryOneOutYearData(paramMap, kpiQuotaLimitMap);
			GeneralMethods.getInstance().addAllValueToMap(queryOneOutYearData, resultMap);

			// 门诊人数 -门诊人数的同比、生成同比环比
			MakeJFreeChartImgParamHelper.makeMeterImgParamData(resultMap, paramMap, kpiQuotaLimitMap, new String[] {
					"同比", "k2_3_4_1_yoy_end", "KPI0039", "0", "k2_3_4_1_yoy_flag_end" });
			jFreeChartHelper.createMeterChart(resultMap, paramMap, "k2_3_4_1_days_meter_yoy_img");

			MakeJFreeChartImgParamHelper.makeMeterImgParamData(resultMap, paramMap, kpiQuotaLimitMap, new String[] {
					"环比", "k2_3_4_1_mom_end", "KPI0039", "1", "k2_3_4_1_mom_flag_end" });
			jFreeChartHelper.createMeterChart(resultMap, paramMap, "k2_3_4_1_days_meter_mom_img");

			// 门诊人数 -人均费用的同比、生成同比环比
			MakeJFreeChartImgParamHelper.makeMeterImgParamData(resultMap, paramMap, kpiQuotaLimitMap, new String[] {
					"同比", "k2_3_4_2_yoy_end", "KPI0052", "0", "k2_3_4_2_yoy_flag_end" });
			jFreeChartHelper.createMeterChart(resultMap, paramMap, "k2_3_4_2_fee_meter_yoy_img");

			MakeJFreeChartImgParamHelper.makeMeterImgParamData(resultMap, paramMap, kpiQuotaLimitMap, new String[] {
					"环比", "k2_3_4_2_fee_mom_end", "KPI0052", "1", "k2_3_4_2_mom_flag_end" });
			jFreeChartHelper.createMeterChart(resultMap, paramMap, "k2_3_4_2_fee_meter_mom_img");

			// 2、门诊人数 -人均费用 ----------------- 混合图表
			paramMap.put("xyLine_chartDTO", new BaseChartDTO("门诊人数和人均费用", "1", GeneralMethods.getInstance()
					.reversalStr("人均费用)元("), "门诊人数(人)"));
			paramMap.put(
					"xyLine_chartDataDTO",
					RtfElementDataHelper.getInstance().createAvgBedFeeSeriesList(resultMap, KpiValueConst.WORD_PARTY_3,
							kpiBatchDTO.getKpiTime(), false));

			jFreeChartHelper.createCombinedChart(resultMap, paramMap, "k2_3_4_2_fee_xyLine_img");

			// 1、平均住院日 变化趋势图(天)
			paramMap.put("xyLine_chartDTO", new BaseChartDTO("门诊人数  变化趋势图(人)", "1"));
			paramMap.put(
					"xyLine_chartDataDTO",
					RtfElementDataHelper.getInstance().createZyRiYearSeriesList(resultMap, KpiValueConst.WORD_PARTY_3,
							kpiBatchDTO.getKpiTime(), false, true));

			jFreeChartHelper.createXYLineChart(resultMap, paramMap, "k2_3_4_2_zy_xyLine_img");

			// 2、平均住院日 同比环比变化趋势图
			paramMap.put("xyLine_chartDTO", new BaseChartDTO("门诊人数  同比环比变化趋势图", "2"));
			paramMap.put(
					"xyLine_chartDataDTO",
					RtfElementDataHelper.getInstance().createZyRiYoyMomSeriesList(resultMap,
							KpiValueConst.WORD_PARTY_3, kpiBatchDTO.getKpiTime(), false, true));

			jFreeChartHelper.createXYLineChart(resultMap, paramMap, "k2_3_4_2_zy_yc_xyLine_img");

			// 3、平均床日费 变化趋势图(天)
			paramMap.put("xyLine_chartDTO", new BaseChartDTO("人均费用  变化趋势图(元)", "1"));
			paramMap.put(
					"xyLine_chartDataDTO",
					RtfElementDataHelper.getInstance().createZyRiYearSeriesList(resultMap, KpiValueConst.WORD_PARTY_3,
							kpiBatchDTO.getKpiTime(), false, true));

			jFreeChartHelper.createXYLineChart(resultMap, paramMap, "k2_3_4_2_cr_xyLine_img");

			// 4、平均床日费 变化趋势图(天)
			paramMap.put("xyLine_chartDTO", new BaseChartDTO("人均费用  同比环比变化趋势图", "2"));
			paramMap.put(
					"xyLine_chartDataDTO",
					RtfElementDataHelper.getInstance().createZyRiYoyMomSeriesList(resultMap,
							KpiValueConst.WORD_PARTY_3, kpiBatchDTO.getKpiTime(), false, true));

			jFreeChartHelper.createXYLineChart(resultMap, paramMap, "k2_3_4_2_cr_yc_xyLine_img");
		}
	}

	/**
	 * 人均费用
	 * 
	 * @param resultMap
	 *            resultMap
	 * @param paramMap
	 *            paramMap
	 * @param kpiQuotaLimitMap
	 *            kpiQuotaLimitMap
	 * @param kpiBatchDTO
	 *            kpiBatchDTO
	 */
	@Override
	public void getAvgPeopleTimesFeeInOutpatData(Map<String, Object> resultMap, Map<String, Object> paramMap,
			Map<String, Object> kpiQuotaLimitMap, KpiBatchDTO kpiBatchDTO) {
		// 和上面方法合并了.这个方法空在这里，暂时
	}

	/**
	 * 空数据 基金
	 * 
	 * @param resultMap
	 *            resultMap
	 * @param paramMap
	 *            paramMap
	 * @param kpiQuotaLimitMap
	 *            kpiQuotaLimitMap
	 * @param kpiBatchDTO
	 *            kpiBatchDTO
	 */
	@Override
	public void getFundData(Map<String, Object> resultMap, Map<String, Object> paramMap,
			Map<String, Object> kpiQuotaLimitMap, KpiBatchDTO kpiBatchDTO) {
		// 基金接口暂时没数据，接口先空这里
	}

	/**
	 * 各科室对比
	 * 
	 * @param resultMap
	 *            resultMap
	 * @param paramMap
	 *            paramMap
	 * @param kpiQuotaLimitMap
	 *            kpiQuotaLimitMap
	 * @param kpiBatchDTO
	 *            kpiBatchDTO
	 */
	@SuppressWarnings("unchecked")
	@Override
	public void getWordDeptsContrast(Map<String, Object> resultMap, Map<String, Object> paramMap,
			Map<String, Object> kpiQuotaLimitMap, KpiBatchDTO kpiBatchDTO) {
		Map<String, Object> queryWorkDeptsData = wordReportService.queryWorkDeptsData(paramMap,
				KpiValueConst.VISIT_TYP_HOSP);
		GeneralMethods.getInstance().addAllValueToMap(queryWorkDeptsData, resultMap);

		Map<String, Object> queryFundRisk = wordReportService.queryWorkDeptsData(paramMap,
				KpiValueConst.VISIT_TYP_OUTPAT);
		GeneralMethods.getInstance().addAllValueToMap(queryFundRisk, resultMap);

		// 住院:各科室对比
		Table table = CreateRtfTableDataHelper.getInstance().crateWordDeptsContrasTable(
				(List<String[]>) resultMap.get("k2_2_5_1_tableList_end"));

		resultMap.put("k2_2_5_1_table", CreateRtfTableDataHelper.getInstance()
				.getTableStr(table, rtfReportTemplatePath));

		// 门诊:各科室对比
		table = CreateRtfTableDataHelper.getInstance().crateWordDeptsContrasTable(
				(List<String[]>) resultMap.get("k2_3_5_1_tableList_end"));

		resultMap.put("k2_3_5_1_table", CreateRtfTableDataHelper.getInstance()
				.getTableStr(table, rtfReportTemplatePath));

		// 2、住院：各科室对比的饼图
		paramMap.put("xyLine_chartDTO", new BaseChartDTO("各科室费用占比", "2"));
		paramMap.put("xyLine_chartDataDTO", RtfElementDataHelper.getInstance()
				.getDeptRatePieSeriesList(resultMap, true)); // 生成饼图
		jFreeChartHelper.createPieChartPic(resultMap, paramMap, "k2_2_5_1_pie_img");

		// 3、门诊：各科室对比的饼图
		paramMap.put("xyLine_chartDTO", new BaseChartDTO("各科室费用占比", "2"));
		paramMap.put("xyLine_chartDataDTO",
				RtfElementDataHelper.getInstance().getDeptRatePieSeriesList(resultMap, false)); // 生成饼图
		jFreeChartHelper.createPieChartPic(resultMap, paramMap, "k2_3_5_1_pie_img");

	}

	// -------------------门诊：郑超 end------------------------------------------

	// ------第二部分------------------------------------------------------------------------
	/**
	 * TODO 张纪成 k1_2_3_1_table
	 * 
	 * @param resultMap
	 *            resultMap
	 * @param paramMap
	 *            paramMap
	 * @param kpiQuotaLimitMap
	 *            limitMap
	 */
	@SuppressWarnings("unchecked")
	@Override
	public void getTotFeeAndMedFeeRate(Map<String, Object> resultMap, Map<String, Object> param,
			Map<String, Object> limitMap) {
		Map<String, Object> totalFeePredict = wordReportService.getTotalFeePredict(param, limitMap);

		GeneralMethods.getInstance().addAllValueToMap(totalFeePredict, resultMap);

		Table table = CreateRtfTableDataHelper.getInstance().crateTotFeeAndMedFeeRateTable(
				(List<String[]>) resultMap.get("k1_1_1_1_tableList_end"));

		String tableStr = CreateRtfTableDataHelper.getInstance().getTableStr(table, rtfReportTemplatePath);

		resultMap.put("k1_1_1_1_table_end", tableStr);
	}

	/**
	 * 杨理刚：k1_2_1_1 第二部分：住院费用和医保费用占比
	 * 
	 * @param resultMap
	 *            resultMap
	 * @param paramMap
	 *            paramMap
	 * @param kpiQuotaLimitMap
	 *            limitMap
	 */
	@SuppressWarnings("unchecked")
	@Override
	public void getHospFeeAndMedFeeRate(Map<String, Object> resultMap, Map<String, Object> paramMap,
			Map<String, Object> limitMap) {
		Map<String, Object> hosFeeToWord = wordReportService.getHosFeeToWord(paramMap, limitMap);

		GeneralMethods.getInstance().addAllValueToMap(hosFeeToWord, resultMap);

		Table table = CreateRtfTableDataHelper.getInstance().crateHostFeeAndMedRateTable(
				(List<String[]>) resultMap.get("k1_2_1_1_tableList_end"), "1.1住院费用 (万元)");

		String tableStr = CreateRtfTableDataHelper.getInstance().getTableStr(table, rtfReportTemplatePath);

		resultMap.put("k1_2_1_1_table_end", tableStr);
	}

	/**
	 * 住院:药品和其他费用占比 各机构按对比 门诊:药品和其他费用占比 各机构按对比
	 * 
	 * @param resultMap
	 *            resultMap
	 * @param paramMap
	 *            paramMap
	 */
	@SuppressWarnings("unchecked")
	@Override
	public void getDrugFeeAndOtherFeeRate(Map<String, Object> resultMap, Map<String, Object> paramMap) {

		Map<String, Object> queryWorkDeptsData = wordReportService.getHosGradeFeeToWordByGrade(paramMap);
		GeneralMethods.getInstance().addAllValueToMap(queryWorkDeptsData, resultMap);

		Table table = CreateRtfTableDataHelper.getInstance().crateDrugFeeAndOtherFeeRateTable1(
				(List<String[]>) resultMap.get("k1_2_2_1_yp_tableList_end"),
				new String[] { "2.1药品费     (万元)", "2.2检查费     (万元)", "2.3治疗费     (万元)" });

		resultMap.put("k1_2_2_1_table_end",
				CreateRtfTableDataHelper.getInstance().getTableStr(table, rtfReportTemplatePath));

		table = CreateRtfTableDataHelper.getInstance().crateDrugFeeAndOtherFeeRateTable2(
				(List<String[]>) resultMap.get("k1_2_2_1_yp_tableList_end"),
				new String[] { "2.4手术费     (万元)", "2.5其他费     (万元)", "2.6化验费     (万元)" });

		resultMap.put("k1_2_2_2_table_end",
				CreateRtfTableDataHelper.getInstance().getTableStr(table, rtfReportTemplatePath));

		table = CreateRtfTableDataHelper.getInstance().crateDrugFeeAndOtherFeeRateTable3(
				(List<String[]>) resultMap.get("k1_2_2_1_yp_tableList_end"), new String[] { "2.7其余费用(万元)" });

		resultMap.put("k1_2_2_3_table_end",
				CreateRtfTableDataHelper.getInstance().getTableStr(table, rtfReportTemplatePath));

	}

	/**
	 * TODO 张纪成 k1_2_3_1_tableList 住院:人次和人均费用
	 * 
	 * @param resultMap
	 *            resultMap
	 * @param paramMap
	 *            paramMap
	 */
	@SuppressWarnings("unchecked")
	@Override
	public void getDischargePeoplesAndTimesCostFee(Map<String, Object> resultMap, Map<String, Object> paramMap) {
		Map<String, Object> hosFeeToWord = wordReportService.getBetweenPersonHospNumAverageFee(paramMap);
		GeneralMethods.getInstance().addAllValueToMap(hosFeeToWord, resultMap);

		Table table = CreateRtfTableDataHelper.getInstance().createAvgHospAndAvgBedTable(
				(List<String[]>) resultMap.get("k1_2_3_1_tableList_end"), new String[] { "3.1出院人次(人次)", "3.2次均费用(元)" });

		resultMap.put("k1_2_3_1_table_end",
				CreateRtfTableDataHelper.getInstance().getTableStr(table, rtfReportTemplatePath));
	}

	/**
	 * TODO 郑超 住院:平均住院日和平均床日费
	 * 
	 * @param resultMap
	 *            resultMap
	 * @param paramMap
	 *            paramMap
	 */
	@SuppressWarnings("unchecked")
	@Override
	public void getAvgHospBedDayFee(Map<String, Object> resultMap, Map<String, Object> paramMap) {
		Map<String, Object> queryMoreOrgData = wordReportService.queryMoreOrgData(paramMap);

		GeneralMethods.getInstance().addAllValueToMap(queryMoreOrgData, resultMap);

		Table table = CreateRtfTableDataHelper.getInstance()
				.createAvgHospAndAvgBedTable((List<String[]>) resultMap.get("k1_2_4_1_tableList_end"),
						new String[] { "4.1平均住院日(天)", "4.2平均床日费(元)" });

		resultMap.put("k1_2_4_1_table_end",
				CreateRtfTableDataHelper.getInstance().getTableStr(table, rtfReportTemplatePath));

	}

	/**
	 * 杨理刚 k1_3_1_1 门诊费用和医保费用占比 第二部分
	 * 
	 * @param resultMap
	 *            resultMap
	 * @param paramMap
	 *            paramMap
	 * @param kpiQuotaLimitMap
	 *            limitMap
	 */
	@SuppressWarnings("unchecked")
	@Override
	public void getOutpatFeeAndMedFeeRate(Map<String, Object> resultMap, Map<String, Object> paramMap,
			Map<String, Object> limitMap) {
		Map<String, Object> outFeeToWord = wordReportService.getOutFeeToWord(paramMap, limitMap);

		GeneralMethods.getInstance().addAllValueToMap(outFeeToWord, resultMap);

		Table table = CreateRtfTableDataHelper.getInstance().crateHostFeeAndMedRateTable(
				(List<String[]>) resultMap.get("k1_3_1_1_tableList_end"), "1.1门诊费用(万元)");

		resultMap.put("k1_3_1_1_table_end",
				CreateRtfTableDataHelper.getInstance().getTableStr(table, rtfReportTemplatePath));

	}

	/**
	 * 门诊:药品和其他费用的各机构按对比
	 * 
	 * @param resultMap
	 *            resultMap
	 * @param paramMap
	 *            paramMap
	 */
	@SuppressWarnings("unchecked")
	@Override
	public void getDrugFeeAndOtherFeeInOutpat(Map<String, Object> resultMap, Map<String, Object> paramMap) {
		Map<String, Object> queryWorkDeptsData = wordReportService.getOutGradeFeeToWordByGrade(paramMap);
		GeneralMethods.getInstance().addAllValueToMap(queryWorkDeptsData, resultMap);

		Table table = CreateRtfTableDataHelper.getInstance().crateDrugFeeAndOtherFeeRateTable1(
				(List<String[]>) resultMap.get("k1_3_2_1_yp_tableList_end"),
				new String[] { "2.1药品费     (万元)", "2.2检查费     (万元)", "2.3治疗费     (万元)" });

		String tableStr = CreateRtfTableDataHelper.getInstance().getTableStr(table, rtfReportTemplatePath);

		resultMap.put("k1_3_2_1_table_end", tableStr);

		table = CreateRtfTableDataHelper.getInstance().crateDrugFeeAndOtherFeeRateTable2(
				(List<String[]>) resultMap.get("k1_3_2_1_yp_tableList_end"),
				new String[] { "2.4手术费     (万元)", "2.5其他费     (万元)", "2.6化验费     (万元)" });

		tableStr = CreateRtfTableDataHelper.getInstance().getTableStr(table, rtfReportTemplatePath);

		resultMap.put("k1_3_2_2_table_end", tableStr);

		table = CreateRtfTableDataHelper.getInstance().crateDrugFeeAndOtherFeeRateTable3(
				(List<String[]>) resultMap.get("k1_3_2_1_yp_tableList_end"), new String[] { "2.7其余费用(万元)" });

		tableStr = CreateRtfTableDataHelper.getInstance().getTableStr(table, rtfReportTemplatePath);

		resultMap.put("k1_3_2_3_table_end", tableStr);
	}

	/**
	 * TODO 张纪成 k1_3_3_2 门诊:人均费用和次均费用
	 * 
	 * @param resultMap
	 *            resultMap
	 * @param paramMap
	 *            paramMap
	 */
	@SuppressWarnings("unchecked")
	@Override
	public void getPeopleTimesAndTimeCostInOutpat(Map<String, Object> resultMap, Map<String, Object> paramMap) {
		Map<String, Object> hosFeeToWord = wordReportService.getBetweenPersonOutNumAverageFee(paramMap);
		GeneralMethods.getInstance().addAllValueToMap(hosFeeToWord, resultMap);

		Table table = CreateRtfTableDataHelper.getInstance().createAvgHospAndAvgBedTable(
				(List<String[]>) resultMap.get("k1_3_3_1_tableList_end"),
				new String[] { "3.1门诊人次 (人次)", "3.2次均费用 (元)" });

		resultMap.put("k1_3_3_1_table_end",
				CreateRtfTableDataHelper.getInstance().getTableStr(table, rtfReportTemplatePath));
	}

	/**
	 * TODO 郑超 门诊:门诊人数和人均费用
	 * 
	 * @param resultMap
	 *            resultMap
	 * @param paramMap
	 *            paramMap
	 */
	@SuppressWarnings("unchecked")
	@Override
	public void getPeoplesAndPeopleFeeInOutpat(Map<String, Object> resultMap, Map<String, Object> paramMap) {
		Map<String, Object> queryMoreOrgData = wordReportService.queryMorOrgOutData(paramMap);

		GeneralMethods.getInstance().addAllValueToMap(queryMoreOrgData, resultMap);

		Table table = CreateRtfTableDataHelper.getInstance().createAvgHospAndAvgBedTable(
				(List<String[]>) resultMap.get("k1_3_4_1_tableList_end"), new String[] { "4.1门诊人数(人)", "4.2人均费用(元)" });

		resultMap.put("k1_3_4_1_table_end",
				CreateRtfTableDataHelper.getInstance().getTableStr(table, rtfReportTemplatePath));
	}

    /**
     * {@inheritDoc}
     */
    @Override
    public void getHosMonthCheckFee(Map<String, Object> resultMap,
            Map<String, Object> paramMap) {
        Map<String, Object> monthCheckDataMap = wordReportService
                .getMonthCheckFee(paramMap);
        // 住院和门诊的数据
        resultMap.putAll(monthCheckDataMap);

        double refuseHosMax = geRefuseBarMaxValue(monthCheckDataMap, "k2_2_2_1_refuse_Fee_Cost_View_Line_List_end");
        double SuspHosMax = geSuspBarMaxValue(monthCheckDataMap, "k2_2_2_1_susp_Fee_Cost_View_Line_List_end");
        double refuseOutMax = geRefuseBarMaxValue(monthCheckDataMap, "k2_2_2_2_refuse_Fee_Cost_View_Line_List_end");
        double suspOutMax = geSuspBarMaxValue(monthCheckDataMap, "k2_2_2_2_susp_Fee_Cost_View_Line_List_end");
        // 住院柱拒付状图数据,hos表示住院，refu表示拒付
        CategoryDataset hosRefuMonthCheckData = getRefuseBarData(
                monthCheckDataMap,
                "k2_2_2_1_refuse_Fee_Cost_View_Line_List_end");
        // 住院柱可疑状图数据,hos表示住院，susp表示可疑
        CategoryDataset hosSuspMonthCheckData = getSuspBarData(
                monthCheckDataMap, "k2_2_2_1_susp_Fee_Cost_View_Line_List_end");

        // 门诊柱状图数据，out表示门诊，refu表示可疑
        CategoryDataset outRefuMonthCheckData = getRefuseBarData(
                monthCheckDataMap,
                "k2_2_2_2_refuse_Fee_Cost_View_Line_List_end");
        // 门诊柱状图数据，out表示门诊，susp表示可疑
        CategoryDataset outSuspMonthCheckData = getSuspBarData(
                monthCheckDataMap, "k2_2_2_2_susp_Fee_Cost_View_Line_List_end");

        jFreeChartHelper.createBarChart(hosRefuMonthCheckData, resultMap,
                paramMap, "k2_2_2_1_Refu_Fee_Line_img", "住院费用审查",refuseHosMax);
        jFreeChartHelper.createBarChart(hosSuspMonthCheckData, resultMap,
                paramMap, "k2_2_2_1_Susp_Fee_Line_img", "住院费用审查",SuspHosMax);
        jFreeChartHelper.createBarChart(outRefuMonthCheckData, resultMap,
                paramMap, "k2_2_2_2_Refu_Fee_Line_img", "门诊费用审查",refuseOutMax);
        jFreeChartHelper.createBarChart(outSuspMonthCheckData, resultMap,
                paramMap, "k2_2_2_2_Susp_Fee_Line_img", "门诊费用审查",suspOutMax);

    }

    /**
     * 获取柱状图拒付金额柱状图数据集
     * 
     * @param feeCheckList 拒付数据集合
     * @param rowKey jFreeChart柱状图图例名称
     * @return 拒付柱状图显示的数据结果
     */
    @SuppressWarnings("unchecked")
    private CategoryDataset getRefuseBarData(
            Map<String, Object> monthCheckDataMap, String key) {
        Object refuMonthCheckList = monthCheckDataMap.get(key);
        if (refuMonthCheckList == null) {
            return new DefaultCategoryDataset();
        }
        DefaultCategoryDataset dataset = new DefaultCategoryDataset();
        for (FeeCheckDTO feeCheckDTO : (List<FeeCheckDTO>) refuMonthCheckList) {
            dataset.addValue(feeCheckDTO.getOutAmountPercent(), "拒付金额占比",
                    feeCheckDTO.getDeptName());
        }
        return dataset;
    }

    /**
     * 获取柱状图可疑金额柱状图数据集
     * 
     * @param feeCheckList 可疑数据集合
     * @param rowKey 图例名称
     * @return 可疑柱状图显示的数据结果
     */
    @SuppressWarnings("unchecked")
    private CategoryDataset getSuspBarData(
            Map<String, Object> monthCheckDataMap, String key) {
        Object suspFeeCheckList = monthCheckDataMap.get(key);
        if (suspFeeCheckList == null) {
            return new DefaultCategoryDataset();
        }
        DefaultCategoryDataset dataset = new DefaultCategoryDataset();
        for (FeeCheckDTO feeCheckDTO : (List<FeeCheckDTO>) suspFeeCheckList) {
            dataset.addValue(feeCheckDTO.getSuspAmountPercent(), "可疑金额占比",
                    feeCheckDTO.getDeptName());
        }
        return dataset;
    }
    
    /**
     * 获取拒付坐标轴的最大值，返回柱状图Y轴，比数据最大值大20%
     * 
     * @param monthCheckDataMap 数据Map
     * @param key key
     * @return 柱状图Y轴坐标最大值
     */
    @SuppressWarnings("unchecked")
    private double geRefuseBarMaxValue(Map<String, Object> monthCheckDataMap,
            String key) {
        Object suspFeeCheckList = monthCheckDataMap.get(key);
        if (suspFeeCheckList == null
                || CollectionUtils
                        .isEmpty((List<FeeCheckDTO>) suspFeeCheckList)) {
            return 1.0;
        }
        double outAmountPercent = ((List<FeeCheckDTO>) suspFeeCheckList).get(0)
                .getOutAmountPercent();
        if (outAmountPercent > 1.0) {
            return 1.0;
        }
        return outAmountPercent + 0.2;
    }

    /**
     * 获取可疑金额的最大值，返回柱状图Y轴，比数据最大值大20%
     * 
     * @param monthCheckDataMap 数据Map
     * @param key key
     * @return 柱状图Y轴坐标最大值
     */
    @SuppressWarnings("unchecked")
    private double geSuspBarMaxValue(Map<String, Object> monthCheckDataMap,
            String key) {
        Object suspFeeCheckList = monthCheckDataMap.get(key);
        if (suspFeeCheckList == null
                || CollectionUtils
                        .isEmpty((List<FeeCheckDTO>) suspFeeCheckList)) {
            return 1.0;
        }
        double suspAmountPercent = ((List<FeeCheckDTO>) suspFeeCheckList)
                .get(0).getSuspAmountPercent();
        if (suspAmountPercent > 1.0) {
            return 1.0;
        }
        return suspAmountPercent + 0.2;
    }
}
